Add startPath and uploadMaxSize to connector options

Apr 27, 2013 at 12:50 AM
It would be extremely helpful if elFinder.net had the startPath and uploadMaxSize connector options as described here:

https://github.com/Studio-42/elFinder/wiki/Connector-configuration-options
Coordinator
Apr 27, 2013 at 3:09 PM
Edited Apr 27, 2013 at 6:01 PM
Hi, Leniel. I add staptPath property to Root class.
Two things about this property. Firstly if you have more than one root, than by default will be select root with startPath. If you set startPath to all roots, than will select fisrt root in list. And secondly, this option affect only when user load page at first time, after it the last selected folder is stored in browser local storage. If you want to always open file manager in the specific folder, you must set 'rememberLastDir' = false in client configiration (https://github.com/Studio-42/elFinder/wiki/Client-configuration-options#wiki-rememberLastDir)
Apr 27, 2013 at 7:23 PM
Edited Apr 27, 2013 at 7:26 PM
Evgeny,

Awesome! I implemented it a little bit different and it's working right now... but I like the way you did it! I'll use your code... :)

Here's how I did before:

In Root.cs:

I added a private field _startPath and assigned it in the Root constructor. I exposed it through a public property called StartPath.

In FileSystemDriver.cs inside the Init method:
if (string.IsNullOrEmpty(target))
{
    root = _roots.First();

    dir = string.IsNullOrEmpty(root.StartPath) ? root.Directory :
    root.Directory.GetDirectories().Single(d => d.Name == root.StartPath);
}
I also set the rememberLastDir option to false to prevent elFinder going to the last visited directory.

Anyway, thanks for the promptly feedback.

You have great coding skills! Your code is super organized and is very well written. I wish that every project in the world was written this way... :D Congrats.

Leniel
Apr 27, 2013 at 7:24 PM
Just one thing: what about the uploadMaxSize? you did not mention it in your reply.
Coordinator
Apr 28, 2013 at 12:36 AM
Yes, I am just implemented it. Please, checkout the source code
Apr 28, 2013 at 2:55 AM
Edited Apr 28, 2013 at 6:58 AM
Evgeny,

I cannot refrain from congratulating you. What a job you've done with this port!!! I saw in the commit that you also implemented the file download capability. Before I tried clicking the download button and nothing happened. Now I see that the download just works.

I'm preparing a blog post to showcase elFinder.Net. I'll update this post with the link when I publish it...

EDIT: www.leniel.net/2013/04/manage-folders-and-files-in-your-aspnet-mvc-project-with-elfinder-net-file-manager.htm

Keep the lib evolving man!

All the best because you deserve it,

Leniel
Coordinator
Apr 28, 2013 at 1:13 PM
It's cool, man! I add link to your blog post at home page of project, it will helpful for some people to use this port.

Cheers