From 480faae00b0d5ab545506e81d744be781059f8bb Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Mon, 5 Jun 2023 17:11:36 +0300 Subject: Resize image on Upload --- Controllers/ProductsController.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Controllers/ProductsController.cs') diff --git a/Controllers/ProductsController.cs b/Controllers/ProductsController.cs index 79b4efd..9c1cdd2 100644 --- a/Controllers/ProductsController.cs +++ b/Controllers/ProductsController.cs @@ -88,8 +88,8 @@ namespace MyDarling.Controllers { Directory.CreateDirectory(directoryPath); } - using var fileStream = new FileStream(fullPath, FileMode.Create); - await file.CopyToAsync(fileStream); + + resizer.WriteResized(file, fullPath); } if (!string.IsNullOrEmpty(fullPath)) -- cgit v1.2.3