-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Allow upload with empty file #1710
Allow upload with empty file #1710
Conversation
Adrian Chung seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, other than my one question. Also, could you write some unit tests that exercise allowEmpty: true
?
@@ -326,7 +326,7 @@ | |||
|
|||
this._templating.updateProgress(id, loaded, total); | |||
|
|||
if (Math.round(loaded / total * 100) === 100) { | |||
if (total === 0 || Math.round(loaded / total * 100) === 100) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Unit tests have been added. I'm not sure what the CLA is for as I'm split between two github accounts right now and I've signed it on both. If it's a problem I can dig further to see what's happening there. |
var validationDescriptor = { size: 0 }; | ||
|
||
fineuploader._validateFileOrBlobData({}, validationDescriptor) | ||
.then(function() { assert.fail(); }, function() {}); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
var validationDescriptor = { size: 0 }; | ||
|
||
fineuploader._validateFileOrBlobData({}, validationDescriptor) | ||
.then(function() { assert.fail(); }, function() {}); | ||
.done(function() { assert.equal(-1, result); }); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
var validationDescriptor = { size: 0 }; | ||
|
||
fineuploader._validateFileOrBlobData({}, validationDescriptor) | ||
.done(function() { assert.equal(-1, result); }); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I'll just run a few quick manual tests sometime in the next few days or so. If all looks good, I'll release this as 5.12.0. Thanks for your work on this! |
This has been merged into develop. I hope to release v5.12.0 this weekend. Thanks again! |
Brief description of the changes [REQUIRED]
Implement issue #903 . Allow uploading of 0 byte files. Enhancement on pull request #1673
What browsers and operating systems have you tested these changes on? [REQUIRED]
Chrome 55.0.2883.95 (64-bit) on OSX 10.11.6
Are all automated tests passing? [REQUIRED]
yes
Is this pull request against develop or some other non-master branch? [REQUIRED]
yes