1
how to set default folder in GleamTech fileultimate in MVC C#
Question asked by Reza - 11/25/2017 at 7:58 PM
Answered
Hi, Im using GleamTech fileultimate in mvc. I set root folder like this:
var rootFolder = new FileManagerRootFolder();
rootFolder.Name = "Uploads";
rootFolder.Location = "~/uploads/";
but what if I needed to view "~/upload/images" in some cases?? like when I set queryString like "/filemanager?chooser=true&folder=images" .
have can I set default folder to view and user have access to other folders too.
thanks in advance.

1 Reply

Reply to Thread
0
Cem Alacayir Replied
Employee Post Marked As Answer
You can use InitialFolder property for this, for example:
 
//The path parameter should be in this format: [RootFolderName]:\some\path
fileManager.InitialFolder = "[RootFolderName]:\some\path";
Assume your structure is as follows:
 
Root
|--> Folder1
          |--> Subfolder1
|--> Folder2
         |--> Subfolder2
 
And if you set InitialFolder property to [Root]:\Folder2\Subfolder2, then FileUltimate shows the tree like this and opens that folder:
 
Root
|--> Folder2
         |--> Subfolder2
 
So if RootFolderName and path is different for each page view then you can dynamically build the string accordingly and set InitialFolder to that string, for example:
 
var rootFolder = new FileManagerRootFolder();
rootFolder.Name = "Uploads";
rootFolder.Location = "~/uploads/";

//Build root string [Uploads]:\
var root = string.Format("[{0}]:\", rootFolder.Name);
//Get your folder or path from querystring
var path =  Request.QueryString["folder"];
fileManager.InitialFolder = Path.Combine(root, path);
 
 
 
 

Reply to Thread