Вот мой код:
Код: Выделить всё
public IActionResult UpdateProduct(IFormFile product_image, Product prd)
{
string ImagePath = Path.Combine(_env.WebRootPath,"ProductImages",product_image.FileName);
FileStream fs = new FileStream(ImagePath, FileMode.Create);
product_image.CopyTo(fs);
prd.product_image = product_image.FileName;
_manicontext.tbl_product.Update(prd);
_manicontext.SaveChanges();
return RedirectToAction("FetchProduct");
}
System.IO.IOException: «Процесс не может получить доступ к файлу» красный -kalenji-8771124.jpg', потому что он используется другим процессом.'
Как устранить эту ошибку?
Подробнее здесь: https://stackoverflow.com/questions/788 ... this-error
Мобильная версия