valor-software / ng2-file-upload

Easy to use Angular components for files upload
http://valor-software.github.io/ng2-file-upload/
MIT License
1.91k stars 662 forks source link

get bad request when upload multiple files #956

Open abas1991 opened 6 years ago

abas1991 commented 6 years ago

hi i use angular 4 an .net core, in angular i have this: files: FormData = new FormData(); . . for (let file of event.files) { this.files.append("files", file, file.FileName); } . . postImages:void{ this.http.post(this.baseUrl + "/api/services/app/MyService/PostFiles", this.files).subscribe(result => { }); }

and in .net core web api: public async Task PostFiles(IFormFile[] files) { .. }

when i post my request to .net core web api i get bad request error!

in single file post everything work well , in .net core web api i have this: public async Task PostFiles(IFormFile file)

serebrjakovs commented 5 years ago

use List<IFormFile> files for multiple files