Skip to content

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.

ElFinder - set max upload picture size

KrzysztofPajak105d03427e0f
diff --git a/src/Web/Grand.Web.Admin/Services/ElFinderViewModelService.cs b/src/Web/Grand.Web.Admin/Services/ElFinderViewModelService.cs
index 0befcded3..7b73f1a66 100644
--- a/src/Web/Grand.Web.Admin/Services/ElFinderViewModelService.cs
+++ b/src/Web/Grand.Web.Admin/Services/ElFinderViewModelService.cs
@@ -41,10 +41,10 @@ namespace Grand.Web.Admin.Services
_mediaSettings = mediaSettings;
- if(!string.IsNullOrEmpty(_mediaSettings.FileManagerEnabledCommands))
+ //if(!string.IsNullOrEmpty(_mediaSettings.FileManagerEnabledCommands))
_connector.Options.EnabledCommands = _mediaSettings.FileManagerEnabledCommands.Split(',').Select(x => x.Trim()).ToList();
- if (!string.IsNullOrEmpty(_mediaSettings.FileManagerDisabledUICommands))
+ //if (!string.IsNullOrEmpty(_mediaSettings.FileManagerDisabledUICommands))
_connector.Options.DisabledUICommands = _mediaSettings.FileManagerDisabledUICommands.Split(',').Select(x => x.Trim()).ToList();
_urlpathUploded = "/assets/images/uploaded/";
@@ -62,6 +62,9 @@ namespace Grand.Web.Admin.Services
protected virtual bool NotAllowedExtensions(string extensions)
{
+ if (string.IsNullOrEmpty(extensions))
+ return true;
+
var allowedFileTypes = new List<string>();
if (string.IsNullOrEmpty(_mediaSettings.AllowedFileTypes))
allowedFileTypes = new List<string> { ".gif", ".jpg", ".jpeg", ".png", ".bmp", ".webp" };
@@ -82,7 +85,8 @@ namespace Grand.Web.Admin.Services
_urlpathUploded,
_urlThumb) {
Name = "Volume",
- MaxUploadConnections = 3
+ MaxUploadConnections = 3,
+ MaxUploadSizeInMb = 4
};
volume.ObjectAttributes = new List<FilteredObjectAttribute>() {
new FilteredObjectAttribute()