Added additionalParameter

This commit is contained in:
Florian Kinder
2017-01-12 11:07:27 +01:00
parent 34c0d35c9c
commit 4c6b5a2a58

View File

@@ -31,6 +31,7 @@ export interface FileUploaderOptions {
disableMultipart?:boolean;
itemAlias?: string;
authTokenHeader?: string;
additionalParameter?:{[key: string]: any};
}
export class FileUploader {
@@ -307,6 +308,12 @@ export class FileUploader {
this._onBuildItemForm(item, sendable);
sendable.append(item.alias, item._file, item.file.name);
if (this.options.additionalParameter !== undefined) {
Object.keys(this.options.additionalParameter).forEach((key:string) => {
sendable.append(key, this.options.additionalParameter[key]);
});
}
} else {
sendable = item._file;
}