Upload single and multiple files

73 views
Skip to first unread message

MissAllSuki

unread,
May 11, 2015, 8:02:39 PM5/11/15
to jquery-f...@googlegroups.com
This groups doesn't seem very active and it seems no support is given but oh well, lets try..


I'm trying to implement an "upload all" button as well as a single upload button for each appended file, the issue is that the upload button for each file triggers all the other currently active uploads... there doesn't seem to be a way to only reference a single upload.

I've been following the examples given in the download, I am cloning a button and passing the "data" object to it. but no matter what I do the submit() call triggers every active upload instead of just triggering a single one, the same happens with the cancel button.

Another issue I have encountered is that calling abort() automatically calls the fileuploadfail event but sometimes you don't need that event to be called, for example, when canceling an upload, the user is canceling but the upload wasn't necessary failing.

I have a callback for fileuploadfail that shows whatever error the server returned and it works great but that fileuploadfail event also gets called when abort().

I'm currently abusing data object to pass some temp properties to indicate fileuploadfail that it was called from an abort() and not from uploading a file but it seems extremely hackish doing it.



But my  main concern is how to reference a single upload, Perhaps another method different than passing data and cloning buttons?  and yep, I tried the "jquery-ui" version of the script but its a way too confusing and too bloated for my needs.

I even tried to track each file via a separate array and using the index to reference the current file:

fileUpload.track[data.i].submit().always(function () {
$this.remove();
});

but no luck so far...


Thanks.
Reply all
Reply to author
Forward
0 new messages