fileupload function done is not getting called

Long story short I want to allow users to upload files to server. Im trying to use Jquery fileupload function however it seems to be not working properly.

I have simplified my code to pinpoint the mistake/error.. I figured that done routine is not getting called.

So only the first console.log("add executed") is getting printed.

<input type="file" id="files" name="files[]" />
<output id="list"></output>
$('#files').fileupload({
 dataType : 'json',
 add: function (e, data) {
   data.submit();
   console.log("add executed");
 },
 done: function (e, data) {
   console.log("done executed")
 }
});

console output: "add executed" nothing after this

Upvotes: 0

Views: 43

Answers (1)

Mayuran S
Mayuran S

Reputation: 19

You would need to provide a URL and actually upload the files to a server, and the server needs to send a response (success or error) for you to invoke the “done” callback.

docs

Upvotes: 1

Related Questions