This is a snippet of my code that runs every time a file gets added to the uploader (dropzone.js
). The files are not immediately uploaded but are rather stored in a queue. I would like to be able to maintain this queue throughout post backs.
var myDropzone = this;
var filesUploaded;
myDropzone.on("addedfile", function () {
filesUploaded = myDropzone.getQueuedFiles();
myDropzone.queuedFiles = filesUploaded; // this should be set on each
// postback to be equal to the filesUpload that existed before the postback
});
The files in myDropzone.queuedFiles
should remain after a post back occurs. I would like to have the uploaded files still visible in the uploader, that way user does not need to re-select their files.
I'm new to web dev and I've tried using sessionStorage but I was unable to implement anything working. I'm working with JavaScript (jQuery), ASP.NET and using dropzone.js
as the uploader.
I do realize that myDropzone.queuedFiles = filesUploaded
should only be run when a post back has happened and we have saved the information from filesUploaded
into something we can maintain and access after a postback. How would I do that?