get bad request when upload multiple files #956
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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)
use
List<IFormFile> filesfor multiple files