I have the following code in Angular 2 for a post-form method:
upload(event) {
let files: FileList = event.target.files;
let formData = new FormData();
for (let i = 0, f; f = files[i]; i++) {
formData.append('attachment', files[i], f.name);
}
//call the angular http method
this.http.
.post(URL, formData)
.map((res:Response) =>
res.json()).subscribe(
(success) => {
alert(success._body);
},
(error) => alert(error))
}
}
It works perfectly by sending everything I like, my problem now is in the creation of the C # API, what kind will I receive in the back compatible with FormData? How do I handle it? Is it possible to save it in the bank? If not, how to save to a folder? Thanks for all the help!