Good afternoon,
Can anyone tell me how to get an image in ASP.Net Core?
I have the html page that you are trying to send to the server:
<form method="post" enctype="multipart/form-data" asp-controller="Produto" asp-action="ImageLoad">
<div class="form-group">
<div class="col-md-10">
<p>Upload one or more files using this form:</p>
<input type="file" name="files"/>
</div>
</div>
<div class="form-group">
<div class="col-md-10">
<input type="submit" value="Upload" />
</div>
</div>
</form>
But I do not know how to get this image in, and save it on the bank with the entity.
I think it's something like:
[HttpPost]
public async Task ImageLoad(List<IFormFile> files)
{
foreach (var file in files)
{
// do something
}
Could anyone help me?