This is my code that fire a modal popup and pass the id variable for custom upload file path for each row
$('.editGallery').click(function(e) {
e.preventDefault();
var res = this.id.split("_");
$('#fileupload').fileupload({
url: 'upload/server/php/index.php?id='+res[1],
});
page.showUploadDialog();
});
And this is the index.php file that change the file upload path:
class CustomUploadHandler extends UploadHandler {
protected function get_user_id() {
$id = 0;
if(isset($_GET["id"])){
$id = $_GET["id"];
}
return $id;
}
}
$upload_handler = new CustomUploadHandler(array(
'user_dirs' => true
));
Whit this, I am archive save files in server/php/files/[Id sended] but I have a problem with render previous uploaded files when click on each gallery buttons, if I upload images for the first row and next open modal for secondo row, previously images uploaded for the first row is rendered, and if I refresh all page and click on any gallery button, nothing is rendered.
How I can pass the path of images to render when click on any gallery button?
Best