i use blueimp on php. In HTML i've put a hidden input field to submit the User_ID (after login, ID of the user from DB) to the Upload Handler as $_POST value. I use the User_ID value as upload directory name to separate each users files from each other.
HTML:
<form id="fileupload" action="server/php/index.php" method="POST" enctype="multipart/form-data">
<input type="hidden" name="user_file_directory" id="user_file_directory" value="<?php echo $_SESSION['user_ID']; ?>">
index.php :
<?php
error_reporting(E_ALL | E_STRICT);
require('UploadHandler.php');
$user_filedirectory = $_POST['user_file_directory'];
$urlHolder = 'user_'.$user_filedirectory.'/';
$options = array(
'upload_dir' => $_SERVER['DOCUMENT_ROOT'].'/ds-admin/server/php/'.$urlHolder,
'upload_url' => './server/php/'.$urlHolder.'/',
);
if($urlHolder){
$upload_handler = new UploadHandler($options , true , null);
}
?>
This works fine to upload something and after upload i can see the thumbnails and even enlarge them. But on a reload of the HTML the list of existing Files is empty, thou the files do still exist on server inside the right folder. On re upload of a file i will see only the new files.
How can i retrieve the content of the custom upload folder on HTML Page load? do i have to set the download-file-directory within the script part of the HTML?