From 883241b59da45e0b61a255542dffea9635ee3dfe Mon Sep 17 00:00:00 2001 From: cubiclesoft Date: Sun, 6 Aug 2017 19:49:16 -0700 Subject: [PATCH] Allow maxChunkSize to be a function for dynamic chunk size support. --- js/jquery.fileupload.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/jquery.fileupload.js b/js/jquery.fileupload.js index 5ff151b53..f20bc6d06 100644 --- a/js/jquery.fileupload.js +++ b/js/jquery.fileupload.js @@ -730,7 +730,7 @@ promise = dfd.promise(), jqXHR, upload; - if (!(this._isXHRUpload(options) && slice && (ub || mcs < fs)) || + if (!(this._isXHRUpload(options) && slice && (ub || ($.type(mcs) === 'function' ? mcs(options) : mcs) < fs)) || options.data) { return false; } @@ -753,7 +753,7 @@ o.blob = slice.call( file, ub, - ub + mcs, + ub + ($.type(mcs) === 'function' ? mcs(o) : mcs), file.type ); // Store the current chunk size, as the blob itself