How to Upload File from Angular to ASP.NET Core Web API
I wanted to know how to write it's controller part can anyone help me in that?
What to right inside controller
How to Upload File from Angular to ASP.NET Core Web API
I wanted to know how to write it's controller part can anyone help me in that?
What to right inside controller
Angular simple example: https://codesandbox.io/s/jolly-montalcini-49h53n?file=/src/app/app.component.html Look App Folder
Web Api Controller: Object Rq:
public class UploadFileRq
{
public IFormFile File { get; set; }
}
Controller:
[HttpPut("yourUrl")]
public async Task<IActionResult> UploadFile([FromForm] UploadFileRq file)
{
// your process here
return Ok();
}