I have a dropzone.js instance on a web page with the following options:
autoProcessQueue:false
uploadMultiple:true
parallelUploads:20
maxFiles:20
It is programmatically instantiated, as it is part of a larger form. I have it rigged up to process the queue when the form is submitted.
The goal is for my users to be able to use the dropzone to manage images for an item, so when I load my 'edit/update' view for an item, I'd like to preload the dropzone with the images that had previously been uploaded for that item. Is there a good way to implement this so that the already-there items don't get re-uploaded when they submit their changes to the image list?
Proper way to do it is to use .emit method provided by on dropzone js to add a file and thumbnail to preload images from the server. See sample code below. Taken from https://github.com/enyo/dropzone/wiki/FAQ#how-to-show-files-already-stored-on-server
.emit method from dropzone will trigger init function and if you have any addedfile event callback written for it. e.g. I am using addedfile event add remove button and also attached delete image functionality.
Dropzone is so strong and awesome that you can do anything on it .
Steps to Follow -- >
1)First of all you will have to create a server side script which will get all the filenames and its size and send it as json response.
PHP code :
2)Now you can use the response to display the uploaded files.Write the below code inside the dropzone init function
Javascript Code :
Note : don't take the whole file url path in filename just take the filename itself thats it .
This works