I use the uploadifive plugin to upload multiple files. This works fine, but now I found an error in my implementation that the queue does not clear after the record is created. If the record is created, then uploadifive should show an empty queue for the new record, but it shows the old files in the queue that were previously uploaded. My logic is based on Ajax and java scripts, and I do not refresh the page after submitting the form (if the page is updated, then the queue is white and clean, which is obvious :)).
Below is the code I used to activate Uploadifive to enter my file type:
$('#xyz_uploader').uploadifive({ 'fileTypeDesc' : 'Image Files', 'fileTypeExts' : '*.png;*.jpg;*.jpeg', 'fileType' : ['image/png','image/jpg','image/jpeg'], 'auto' : false, 'checkScript' : 'uploadify_envc.php?checkexist=true', 'formData' : { 'timestamp' : curDateTime, 'token' : 'df324523adg34qtfgiui', 'doc_type' : 'docs', 'somenewval' : $("select#dropdown_control").val(), }, 'buttonText' : 'Upload Document(s)', 'queueID' : 'xyz_uploader_queue', 'auto' : true, 'uploadScript' : 'uploadify_envc.php?injury='+$("select#dropdown_control").val(), 'onUploadComplete' : function(file, data) { HandleUploadiFiveDocs(file,data,"docs"); } });
When I send data using a JS function, I call this function in response to an Ajax call to clear the files in the queue:
$('#xyz_uploader').uploadifive('clearQueue');
But that does not work. I checked this through the browser console and the java-script function, but both of them do not work.
So, you guys can tell me how I can clear the download queue using the java-script command?