i use blueimp jquery for upload files. the files are upload perfect but now i need recovery the name files for insert into my database.
In index.php (server/php) i have this:
session_start();
include_once('../../include/database.php');
error_reporting(E_ALL | E_STRICT);
require_once('UploadHandler.php');
define("DIR_DOWNLOAD", "/Applications/XAMPP/htdocs/villalba2");
define("HTTP_SERVER", "/villalba2");
$cat=$_SESSION['nombre'];
$id_cat=$_SESSION['id_cat'];
$options = array(
'upload_dir' => DIR_DOWNLOAD . '/uploads/' . $cat. '/',
'upload_url' => HTTP_SERVER . '/uploads/' . $cat. '/',
);
$upload_handler = new UploadHandler($options);
I need recovery a file names in order to insert into my database.
the json create by blueimp is:
Array
(
[files] => Array
(
[0] => stdClass Object
(
[name] => project-1.jpg
[size] => 69077
[url] => /villalba2/uploads/Mobiliario/project-1.jpg
[thumbnailUrl] => /villalba2/uploads/Mobiliario/thumbnail/project-1.jpg
[deleteUrl] => http://localhost/villalba2/admin/server/php/?file=project-1.jpg
[deleteType] => DELETE
)
[1] => stdClass Object
(
[name] => project-2.jpg
[size] => 42109
[url] => /villalba2/uploads/Mobiliario/project-2.jpg
[thumbnailUrl] => /villalba2/uploads/Mobiliario/thumbnail/project-2.jpg
[deleteUrl] => http://localhost/villalba2/admin/server/php/?file=project-2.jpg
[deleteType] => DELETE
)
[2] => stdClass Object
(
[name] => project-7.jpg
[size] => 91440
[url] => /villalba2/uploads/Mobiliario/project-7.jpg
[thumbnailUrl] => /villalba2/uploads/Mobiliario/thumbnail/project-7.jpg
[deleteUrl] => http://localhost/villalba2/admin/server/php/?file=project-7.jpg
[deleteType] => DELETE
)
)
)
How to acces into the json from PHP for recovery the file name?? thanks!