I am trying to POST image file and a set of parameters using ASP.NET Core. Is there any option/solution to send both Model Data and Image at the same time in POST API. Here is the image of POST API in POSTMAN:
Here is body with Model Information:
If I do it like following code then my companyInfo data is null and image is there.
[HttpPost("PostInformation")]
public async Task<ActionResult<Company>> PostEmployeeJobCategories(IFormFile image, [FromForm]Company companyInfo)
{
}
If I do it like following code then I am getting Unsupported Media Type.
[HttpPost("PostInformation")]
public async Task<ActionResult<Company>> PostEmployeeJobCategories([FromForm]IFormFile image, [FromBody]Company companyInfo)
{
}
Any Advise, how to achieve the goal ?
Thank You