Skip to content
This repository was archived by the owner on May 25, 2023. It is now read-only.

Added option to group files in one XHR request based on their file size ... #2740

Merged
merged 1 commit into from
Nov 15, 2013

Conversation

ottens
Copy link
Contributor

@ottens ottens commented Nov 15, 2013

...and the upload file size limit

If your upload limit is say 1MB and you have 100 files of 20Kb you could set the limitMultiFileUploads to 50 to minimize requests. However is there is one 30kb file the batch containing that group will fail. So I coded an uploadSizeLimitMultiFileUploads option that will calculate the max number of files that fit in one request based on a set upload size. I added a 512 bytes overhead for each file for the calculations to be on the safe side. Hope you find these useful, it is very useful if you want to upload 1000s of small files. Thanks

Signed-off-by: Maarten Ottens m@maartenottens.com

…ze and the upload file size limit

If your upload limit is say 1MB and you have 100 files of 20Kb you could set the limitMultiFileUploads to 50 to minimize requests. However is there is one 30kb file the batch containing that group will fail. So I coded an uploadSizeLimitMultiFileUploads option that will calculate the max number of files that fit in one request based on a set upload size. I added a 512 bytes overhead for each file for the calculations to be on the safe side. Hope you find these useful, it is very useful if you want to upload 1000s of small files. Thanks

Signed-off-by: Maarten Ottens <m@maartenottens.com>
blueimp added a commit that referenced this pull request Nov 15, 2013
Added option to group files in one XHR request based on their file size ...
@blueimp blueimp merged commit 54729b2 into blueimp:master Nov 15, 2013
blueimp added a commit that referenced this pull request Nov 15, 2013
@blueimp
Copy link
Owner

blueimp commented Nov 15, 2013

Thanks for your contribution, @ottens.
I've released a new version based on your pull request (slightly refactored and with a unit test added).

@ottens
Copy link
Contributor Author

ottens commented Nov 15, 2013

Thanks, glad I could contribute.

@dougdomeny
Copy link
Contributor

@ottens, thanks for adding the limitMultiFileUploadSize option. I needed it too and the solution I came up with was not as elegant.

GerHobbelt added a commit to GerHobbelt/jQuery-File-Upload that referenced this pull request Mar 11, 2014
Added options limitMultiFileUploadSize and limitMultiFileUploadSizeOverhead based on @ottens pull request blueimp#2740.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants