Skip to content

Commit

Permalink
feat(fileUpload): added additionalParameter (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fank authored and valorkin committed Jan 17, 2017
1 parent e4a7099 commit 397de09
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/file-upload/file-uploader.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export interface FileUploaderOptions {
disableMultipart?:boolean;
itemAlias?: string;
authTokenHeader?: string;
additionalParameter?:{[key: string]: any};
}

export class FileUploader {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit 397de09

Please sign in to comment.