Skip to content

Commit 3763448

Browse files
Karanvir KangKaranvir Kang
authored andcommitted
Merge pull request #1 from Karankang007/Karankang007-patch-1
Update flow.js
2 parents c30732f + 7fc4a70 commit 3763448

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/flow.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
* @param {string|Function} [opts.testMethod]
2424
* @param {string|Function} [opts.uploadMethod]
2525
* @param {bool} [opts.prioritizeFirstAndLastChunk]
26+
* @param {bool} [opts.allowDuplicateUploads]
2627
* @param {string|Function} [opts.target]
2728
* @param {number} [opts.maxChunkRetries]
2829
* @param {number} [opts.chunkRetryInterval]
@@ -82,6 +83,7 @@
8283
testMethod: 'GET',
8384
uploadMethod: 'POST',
8485
prioritizeFirstAndLastChunk: false,
86+
allowDuplicateUploads: false,
8587
target: '/',
8688
testChunks: true,
8789
generateUniqueIdentifier: null,
@@ -568,9 +570,9 @@
568570
// Uploading empty file IE10/IE11 hangs indefinitely
569571
// see https://connect.microsoft.com/IE/feedback/details/813443/uploading-empty-file-ie10-ie11-hangs-indefinitely
570572
// Directories have size `0` and name `.`
571-
// Ignore already added files
573+
// Ignore already added files if opts.allowDuplicateUploads is set to false
572574
if ((!ie10plus || ie10plus && file.size > 0) && !(file.size % 4096 === 0 && (file.name === '.' || file.fileName === '.')) &&
573-
!this.getFromUniqueIdentifier(this.generateUniqueIdentifier(file))) {
575+
(opts.allowDuplicateUploads || !this.getFromUniqueIdentifier(this.generateUniqueIdentifier(file)))) {
574576
var f = new FlowFile(this, file);
575577
if (this.fire('fileAdded', f, event)) {
576578
files.push(f);

0 commit comments

Comments
 (0)