jquery - Sending an error or success message only after all files have been processed -


I am trying to send success or error messages to the blueships once all the files are processed ... Otherwise the first file will send success message and if there is an error in the second file, then this error will also trigger.

Here is my code:

  // launch the jQuery file upload widget: jQuery ('# fileupload'). Fileupload ({url: url, done: function (e, data) {var response = jQuery.parseJSON (data.jqXHR.responseText); var error = response.files [0] (error) {jQuery ('# error') Show (); jQuery ('# Error') .Append ('<'>  Error returned: & lt; / strong> / P & gt; ');} Other {jQuery (' #Success'). Show ();}},});  

Thanks for any help!

single-file upload options

If you want your files to be on a single request Uploaded, you can use it: Single File Username: Incorrect,

This way only 1 done callback for every file Will be triggered.

Stop callback

Create a global array:

  var temp = new array ();  

Then your done , failed , or always And success status:

  done: function (e, data) {$ .each (data.files, function (i, f) {temp.push ({" Finally, you can see the status of each successor in  stop  in the callback. Which is called when each file is finished:  
  stop: funk (E, data) {$ .eu (temporary, function (i, f) {console.log (f.name) console.log (f.succeed)}); // Do not forget to empty your array to allow other downlaw templates = new arrays; },  

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -