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

Commit fb2c280

Browse files
committed
Merge pull request #2787 from dougdomeny/master
Apply options limitMultiFileUploads AND limitMultiFileUploadSize, check for options.paramName
2 parents 87acbc9 + 3c2e216 commit fb2c280

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

js/jquery.fileupload.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@
419419
file = options.files[0],
420420
// Ignore non-multipart setting if not supported:
421421
multipart = options.multipart || !$.support.xhrFileUpload,
422-
paramName = options.paramName[0];
422+
paramName = options.paramName[0] || options.paramName;
423423
options.headers = $.extend({}, options.headers);
424424
if (options.contentRange) {
425425
options.headers['Content-Range'] = options.contentRange;
@@ -980,7 +980,8 @@
980980
batchSize += files[i].size + overhead;
981981
if (i + 1 === filesLength ||
982982
(batchSize + files[i + 1].size + overhead) >
983-
limitSize) {
983+
limitSize ||
984+
(limit && i + 1 - j >= limit)) {
984985
fileSet.push(files.slice(j, i + 1));
985986
paramNameSlice = paramName.slice(j, i + 1);
986987
if (!paramNameSlice.length) {

0 commit comments

Comments
 (0)