Skip to content

Commit ff9ccb1

Browse files
authored
Merge pull request #299 from drzraf/per-chunk-filename
Per-chunk filenames
2 parents de28124 + 068edf1 commit ff9ccb1

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/flow.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,6 +1169,12 @@
11691169
*/
11701170
this.startByte = this.offset * this.chunkSize;
11711171

1172+
/**
1173+
* A specific filename for this chunk which otherwise default to the main name
1174+
* @type {string}
1175+
*/
1176+
this.filename = null;
1177+
11721178
/**
11731179
* Compute the endbyte in a file
11741180
*
@@ -1512,7 +1518,9 @@
15121518
each(query, function (v, k) {
15131519
data.append(k, v);
15141520
});
1515-
if (typeof blob !== "undefined") data.append(this.flowObj.opts.fileParameterName, blob, this.fileObj.file.name);
1521+
if (typeof blob !== "undefined") {
1522+
data.append(this.flowObj.opts.fileParameterName, blob, this.filename || this.fileObj.file.name);
1523+
}
15161524
}
15171525

15181526
this.xhr.open(method, target, true);

0 commit comments

Comments
 (0)