1

i use jquery file upload plugin, when i browse some files and add them to list everything is going well. After that when i browse some more files and submit, plugin sends two ajax requests. Because i browsed twice.
Is there any option to set this?
I also set the parameter singleFileUploads:false

2
  • Did you ever figure this out, I'm actually facing the same problem right now :). I don't think it's related to browsing, I think it's related to something caching. Commented May 20, 2013 at 18:56
  • No, the plugin creates an instance for every trigger browse. I solved the problem by changing my back-end server. Commented May 21, 2013 at 13:45

2 Answers 2

1

Try to unbind click :

unbind("click")

sample code :

add: function (e, data) {
    $('#btnSave').unbind("click").click(function () {
        $('<li/>').text("click : btnSave").appendTo('#history');
        data.submit();
    });
});
Sign up to request clarification or add additional context in comments.

Comments

0

The only way it would be able to send the files in one go is it were using html5 FormData. It is probably not using that.

You have to learn how ajax files uploads work under the hood to be able to answer your question. There are hidden file inputs that get filled with your selected files every time you hit browse. If it were a single file input you would overwrite your previous selection.

Your only hope is html5 file upload api, but its not available on most IE so its probably not being used by this plugin

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.