Hello,
In this example:
onFileUpload = async () => {
const formData = new FormData();
formData.append(
"ImageData.File",
this.state.selectedFile,
this.state.selectedFile.name
);
And here is ViewModel:
namespace imageEditor3
{
public class ImageData
{
public string Description { get; set; }
public IFormFile File { get; set; }
}
}
As you can see wh have just defined one variable for “File” and we use it as the first parameter in the append, but how is it possible to define two values for it:
this.state.selectedFile,
this.state.selectedFile.name
The code works well. How is it possible?
thanks,
Saeed