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; disableMultipart?:boolean;
itemAlias?: string; itemAlias?: string;
authTokenHeader?: string; authTokenHeader?: string;
additionalParameter?:{[key: string]: any};
} }
export class FileUploader { export class FileUploader {
@@ -307,6 +308,12 @@ export class FileUploader {
this._onBuildItemForm(item, sendable); this._onBuildItemForm(item, sendable);
sendable.append(item.alias, item._file, item.file.name); 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 { } else {
sendable = item._file; sendable = item._file;
} }