Skip to content

Commit

Permalink
Change order of appending data to multipart form (bleenco#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
milenkovic authored and jkuri committed Jan 16, 2017
1 parent b5bffcb commit 1c5998e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/services/ngx-uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ export class NgUploaderService {
uploadFile(file: any): void {
let xhr = new XMLHttpRequest();
let form = new FormData();
form.append(this.opts.fieldName, file, file.name);

Object.keys(this.opts.data).forEach(k => {
form.append(k, this.opts.data[k]);
});

form.append(this.opts.fieldName, file, file.name);

let uploadingFile = new UploadedFile(
this.generateRandomIndex(),
file.name,
Expand Down

0 comments on commit 1c5998e

Please sign in to comment.