Skip to content

Commit

Permalink
feat(uploader): params before file data, close #104
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed May 21, 2018
1 parent bcd377f commit f3254ca
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions components/uploader/uploader.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,11 @@ export class Uploader {
if (!this._options.disableMultipart) {
sendable = new FormData();

sendable.append(item.options.alias, item._file, item.file.name);
Object.keys(this._options.params || {}).forEach((key: string) =>
sendable.append(key, this._options.params[key]),
);

if (this._options.params !== undefined) {
Object.keys(this._options.params).forEach((key: string) => {
sendable.append(key, this._options.params[key]);
});
}
sendable.append(item.options.alias, item._file, item.file.name);
} else {
sendable = item._file;
}
Expand Down

0 comments on commit f3254ca

Please sign in to comment.