Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.
C# aspnet-corecsharpdockerdotnetecommerceecommerce-platformmongodbmulti-storemulti-vendornosqlonline-shopshoppingcart
Minor changes
KrzysztofPajakcd657fbfcb6f
diff --git a/src/Web/Grand.Web.Admin/Controllers/PictureController.cs b/src/Web/Grand.Web.Admin/Controllers/PictureController.csindex a9eb1bcbd..19c707860 100644--- a/src/Web/Grand.Web.Admin/Controllers/PictureController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/PictureController.cs@@ -69,7 +69,7 @@ namespace Grand.Web.Admin.Controllersvar qqFileNameParameter = "qqfilename";var fileName = httpPostedFile.FileName;- if (String.IsNullOrEmpty(fileName) && form.ContainsKey(qqFileNameParameter))+ if (string.IsNullOrEmpty(fileName) && form.ContainsKey(qqFileNameParameter))fileName = form[qqFileNameParameter].ToString();//remove path (passed in IE)fileName = Path.GetFileName(fileName);diff --git a/src/Web/Grand.Web.Admin/Controllers/ProductController.cs b/src/Web/Grand.Web.Admin/Controllers/ProductController.csindex e6cfa1770..71809f4ea 100644--- a/src/Web/Grand.Web.Admin/Controllers/ProductController.cs+++ b/src/Web/Grand.Web.Admin/Controllers/ProductController.cs@@ -1226,13 +1226,13 @@ namespace Grand.Web.Admin.Controllersmessage = "Access denied - staff permissions",});- var values = new List<(string pictureUrl, string pictureId)>();-+ var values = new List<(string pictureUrl, string pictureId, string message)>();+ var message = string.Empty;foreach (var file in httpPostedFiles){var qqFileNameParameter = "qqfilename";var fileName = file.FileName;- if (String.IsNullOrEmpty(fileName) && form.ContainsKey(qqFileNameParameter))+ if (string.IsNullOrEmpty(fileName) && form.ContainsKey(qqFileNameParameter))fileName = form[qqFileNameParameter].ToString();fileName = Path.GetFileName(fileName);@@ -1254,13 +1254,16 @@ namespace Grand.Web.Admin.Controllersvar picture = await pictureService.InsertPicture(fileBinary, contentType, null, reference: reference, objectId: objectId);var pictureUrl = await pictureService.GetPictureUrl(picture);- values.Add((pictureUrl, picture.Id));+ values.Add((pictureUrl, picture.Id, "Ok"));//assign picture to the productawait _productViewModelService.InsertProductPicture(product, picture, 0);+}+ else+ message += $"Not allowed file types to import {fileName}";}- return Json(new { success = true, data = values });+ return Json(new { success = values.Any(), data = values });}protected virtual IList<string> GetAllowedFileTypes(MediaSettings mediaSettings)