Hi @Coreysan ,
var formData = new FormData();
formData.append('image', fileData, fileData);
However, when I call ajax to post to my controller, when I debug the action entry point Upload(IFormFile file), the variable "file" is still null.
The issue relates that the parameter name not matched.
Try to change the formData as below:
var formData = new FormData();
formData.append('file', fileData, fileData);
Or, change the controller's parameter name from file
to image
.
The result as below:
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Best regards,
Dillion