Dropzone: Confusion around uploadMultiple & parallelUploads

Created on 1 Aug 2013  路  18Comments  路  Source: dropzone/dropzone

Hello, first of all thanks for the awesome plugin.

There is something I don't quite get and I would like to understand why you keep this behaviour.

It seems when you set uploadMultiple as true and you keep parallelUploads equal to 2. On drag & drop it looks like it sends as much requests as possible to the server. When you use the file window browser you can select multiple files but it will send 2 per request with as much parallel requests as possible.

When you set the value of parallelUploads to 1, the drag n drop seems to just upload as much as possible again, but now the uploadMultiple only sends 1 file per request as much parallel as possible (still with name as "name[]" )

So on resume, as soon as you set uploadMultiple there is no limit on requests send at same time? I assume if we want to throttle this we need to use the queue?

Cheers,
P

bug

Most helpful comment

If you have uploadMultiple set to true, then one AJAX request should contain as many files as parallelUploads.
If you have uploadMultiple set to false then there will be as many AJAX requests as parallelUploads.

All 18 comments

Hi, I have to check it out. If the behaviour you're describing is correct then it's a bug.
parallelUploads should always be used, whether uploadMultiple is true or false.

I'll get back to you in a bit.

Ok, you're right. That's a bug.

Fixed in a bit.

Thanks for your attention on this issue. I'm just concerned about losing this "bug" that looks like a feature too :). Limiting one file per request through uploading via the file window due to the parallelUploads looked like a nice feature to me. Is this behaviour kept?

What do you mean?

The parallelUploads option should not interfere with the uploadMultiple option. uploadMultiple simply means that multiple files will be transferred in one request. parallelUploads means how many files should be transferred simultaniously (either in one request or in multiple requests).

I'll dig through this issue a bit better but I have a feeling it does impact on that. Because I can see the POST request containing as much images as parallelUploads option. I'll submit a failing scenario if I'm correct.

Edited:

  • This issue seems to only happen for uploads through the file window.

If you have uploadMultiple set to true, then one AJAX request should contain as many files as parallelUploads.
If you have uploadMultiple set to false then there will be as many AJAX requests as parallelUploads.

Exactly see this bug could be considered a feature :) because I could set parallelUploads to 1 and per AJAX request have only one image at time but several uploads at same time

My point being: this is very important because if one image fails to upload for some reason, let's say a server validation error, you can handle just that image. If you are handling a collection of stuff it's trickier to show errors. Do you understand I mean?

It looks like it would be nice to configure the amount of images sent on each AJAX request ?

Why not just set parallelUploads to 1?

Because then on drag n drop it will only upload 1 at a time? Assuming you fixed the initial issue?

:) ok then why setting uploadMultiple to true?

Because I would like to support both drag and drop and uploading multiple files through the file window. Having 1 as parallelUploads is boring especially on the drag n drop case. Honestly I think sending 1 or multiple per files per request are both as relevant configuration. It's especially way easier to handle single resources than having a collection (more RESTful, more scalable). I'd be happy to try to come up with a solution to support this if you think this is worth to have for everyone.

I still don't quite get what your point is sorry...

I just fixed another bug that might be the problem you're describing:
Up until a few minutes ago, setting uploadMultiple to false also changed the click behaviour, so it allowed only one file to be selected.
This was a bug, and is now fixed.

Regardless of uploadMultiple and parallelUploads, both, the click file chooser and the drag'n'drop functionality, accept multiple files.

So I think, what you want, is setting parallelUploads to 10 (or something) and uploadMultiple to false so that all files are uploaded separately. Right?

Yes.

So the goal is:

  • Able to control how many files I upload on parallel (5-6 is optimal)
  • Always send only 1 file through AJAX
  • Keeping the same behaviour for the file window upload or drag & drop

Fallback I don't care at all, people should upgrade their crappy browsers :)

@enyo I suppose the issue/feature I requested, there is no plans to implement it? i.e. being able to limit always 1 upload per xhr request but still doing as many parallel uploads as we want?

Nevermind my above comment, I just tryed the latest version and it's working exactly as I needed. Thanks very much. :+1:

@pedrocunha glad you're satisfied.

How can we change the preview elements of uploaded file to custom div containers?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mPisano picture mPisano  路  18Comments

USvER picture USvER  路  19Comments

tycoons picture tycoons  路  28Comments

KateMort picture KateMort  路  22Comments

luisyq picture luisyq  路  36Comments