diff --git a/src/services/ngx-uploader.ts b/src/services/ngx-uploader.ts index b307178e..edf08ad3 100644 --- a/src/services/ngx-uploader.ts +++ b/src/services/ngx-uploader.ts @@ -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,