Adds some Fixes for AWS Support. #658
@@ -307,13 +307,20 @@ export class FileUploader {
|
|||||||
sendable = new FormData();
|
sendable = new FormData();
|
||||||
this._onBuildItemForm(item, sendable);
|
this._onBuildItemForm(item, sendable);
|
||||||
|
|
||||||
sendable.append(item.alias, item._file, item.file.name);
|
|
||||||
|
|
||||||
|
// For AWS, Additional Parameters must come BEFORE Files
|
||||||
if (this.options.additionalParameter !== undefined) {
|
if (this.options.additionalParameter !== undefined) {
|
||||||
Object.keys(this.options.additionalParameter).forEach((key:string) => {
|
Object.keys(this.options.additionalParameter).forEach((key:string) => {
|
||||||
sendable.append(key, this.options.additionalParameter[key]);
|
let paramVal = this.options.additionalParameter[key];
|
||||||
|
// Allow an additional parameter to include the filename
|
||||||
|
if (paramVal.indexOf('{{file_name}}') >= 0) {
|
||||||
|
paramVal.replace('{{file_name}}', item.file.name);
|
||||||
|
}
|
||||||
|
sendable.append(key, paramVal);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendable.append(item.alias, item._file, item.file.name);
|
||||||
} else {
|
} else {
|
||||||
sendable = item._file;
|
sendable = item._file;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user