1 (edited by tommedema 2011-04-15 22:54:55)

Topic: Changing upload order on demand

When a user has selected multiple files, is it possible for him/her to change the order of the upload queue?

An example of the file list:

File A
File B
File C

This would result for file A to be send to the server at first.

Is it possible for the user to programmatically change this order, after already having selected the files, to eg.:
File C
File A
File B

Causing file C to be the first to arrive at the server?

Any feedback is appreciated. Thanks.

- Tom

UPDATE:

I now realize that this is only possible with Flash / Silverlight. I will create a feature request, as this would be an awesome feature to have for these two runtimes.

Re: Changing upload order on demand

I've created a feature request, I hope it'll make it in as it's a great feature and in my case a requirement:

https://github.com/moxiecode/plupload/issues/269

Re: Changing upload order on demand

Unless you are talking about something else, it is already possible and even implemented in UI Widget as a visual sortable list - you just need to set sortable option to true.

This will work only in UI Widget. For all other cases you would need to implement logic yourself. It's just as simple as sorting uploader.files array, which is in fact the queue.

If you want to see your issue fixed, do not report it here, do it on - GitHub.

4 (edited by tommedema 2011-04-16 20:43:34)

Re: Changing upload order on demand

@davit, does that even influence the order at which files are uploaded to the server?

Because, I'm pretty sure that is not possible with HTML, I looked at the API multiple times.

To clarify, I believe you're talking about a visual file list order, but not about the order at which the browser sends the list of files to the server. The latter one is the feature I request.

Re: Changing upload order on demand

Order in HTML list is taken directly from the queue, just like files to upload.

If you want to see your issue fixed, do not report it here, do it on - GitHub.

Re: Changing upload order on demand

davit wrote:

Order in HTML list is taken directly from the queue, just like files to upload.

I'm sorry but I do not follow you.

Are you saying that you can determina at which order files are uploaded to the server with a HTML file upload form after the user has already selected which files to upload?

If so, can you link me the API that provides this functionality in HTML5 or 4?

If not, do you now understand what feature I am requesting?

Hopefully we are talking about the same thing now. wink

Thanks again.

Re: Changing upload order on demand

There is no formal API for this.  As @davit mentioned a few posts ago you need to sort the uploader.files javascript array before you call the uploader.start method to begin the actual upload of the selected files.  The plupload code uploads each file as a seperate POST - but you can pick the order of those POSTs by sorting the uploader.files array.

Re: Changing upload order on demand

mike wrote:

There is no formal API for this.  As @davit mentioned a few posts ago you need to sort the uploader.files javascript array before you call the uploader.start method to begin the actual upload of the selected files.  The plupload code uploads each file as a seperate POST - but you can pick the order of those POSTs by sorting the uploader.files array.

Heh, I was talking about the HTML / Javascript API. I could not find such access in mozilla's language specifications.

You say that plupload uploads each file as a separate POST. This surprised me, as I cannot find the way HTML4 allows one to do this, it merely allows one to upload the whole thing as multipart in a fixed order as far as I know.

Could you link me the HTML or Javascript API that would enable what you say is possible, aka an order of upload that can be programatically changed after the user has selected the files? Or the ability to upload files one by one, even though multiple have been selected?

I realize this is possible in Flash/Silverlight, but am not sure about HTML4/5.

Re: Changing upload order on demand

I'd suggest you start by simply trying what @davit has suggested above.  If it works you problem is solved.  If it doesn't then you can start worrying about why at that point in time.

Re: Changing upload order on demand

mike wrote:

I'd suggest you start by simply trying what @davit has suggested above.  If it works you problem is solved.  If it doesn't then you can start worrying about why at that point in time.

Well, since you don't want to link me to the HTML specifications that allow such individual posting mechanic of a multipart form I guess that is the only way for me to try.

I have looked at the source as well, and could not find the behaviour you specified.

Re: Changing upload order on demand

I'm not sure what you want to do with multipart form, but - again, upload order is dictated by the order of the files in the queue, which is represented by the simple array of file objects - uploader.files.

Have you actually tried to re-order entries in that array? And what exactly does not satisfy your needs in this approach, if you have?

If you want to see your issue fixed, do not report it here, do it on - GitHub.