linguanostra / ELFinder.Connector.NET

ELFinder Connector for .NET with support for NancyFX and ASP.NET MVC
BSD 3-Clause "New" or "Revised" License
12 stars 8 forks source link

maxUploadSizeKb config not working #1

Closed bangd closed 8 years ago

bangd commented 8 years ago

ELFinderRootVolumeConfigEntry - maxUploadSizeKb not working in ASP.NET MVC project

bangd commented 8 years ago

Or It should be minUploadSizeKb?

Hdd77 commented 8 years ago

Hello

In the function "IConnectorDriver.Upload" from the class " ELFinder.Connector.Drivers.FileSystem", the condition

        // Check if max upload size is set and that no files exceeds it            
        if (dest.Root.MaxUploadSizeKb.HasValue
            && !fileStreams.Any(x => (x.Stream.Length/1024) > dest.Root.MaxUploadSizeKb))

must be

        // Check if max upload size is set and that no files exceeds it            
        if (dest.Root.MaxUploadSizeKb.HasValue
            && fileStreams.Any(x => (x.Stream.Length/1024) > dest.Root.MaxUploadSizeKb))

and it works.

PS : sorry for my english :)

linguanostra commented 8 years ago

Thanks for the fix, it's working fine now. I've also updated the code.

Also, when the the MaxUploadSizeKb is set to null, there won't be any limitation.

Now, if only I could find some spare time to add some tests, that would be awesome!

Cheers!