Api method is looks like below
[HttpPost]
public async Task> MediaBrand(IFormFile file, int brandId)
Adding (Name = "body") to the from form worked for me
Server Call:
[HttpPost]
[Route("UploadImage")]
public IActionResult UploadImage([FromForm(Name = "body")]IFormFile formData)
Client code:
let formData = new FormData();
formData.append('body', event.target.files[0]);
const config = {
headers: {
'content-type': 'multipart/form-data',
},
}
axios.post(ApiURL,formData, config);