Within my Frontend, I am passing an Object with a PersonId and a FormData object.
const formData = new FormData();
for (let file of files){
formData.append(file.name, file,);
}
formData.append('currentId',this.UserId.toString());
const uploadReq = new HttpRequest('POST', 'https://localhost:5001/api/file',formData, {
reportProgress: true,
});
To access the FormData Object in my backend, I use this line:
var file = Request.Form.Files[0];
The main question is how to retrieve the value of currentId?
One approach I tried was:
var PersonId = Request.Form.Keys;
However, this just returns the keys and not the actual value. Any suggestions on how to extract the value?