I would like to know the full example code for the file manager.

I would like to know a full code example sample for the file manager.

I want to see the D drive of my local PC as a file manager.

I'm not sure how to set it up even looking at the api configuration documentation.
Please give me a sample code so that the D drive can be seen.

1 Reply 1 reply marked as answer

SP Sowmiya Padmanaban Syncfusion Team January 15, 2021 01:34 PM UTC

Hi ArcBlue, 
 
Greetings from Syncfusion support. 
 
We have checked your requirement with FileManager component. By default, FileManager support only the single root folder for accessing the files/folder. 
 
To achieve your requirement, you need to set the root folder for FileManager component in your controller side. 
 
Please, refer to the below code snippet. 
 
public class HomeController : Controller 
    { 
        public PhysicalFileProvider operation; 
        public string basePath; 
        string root = "D:\\FileManager"; 
        public HomeController(IHostingEnvironment hostingEnvironment) 
        { 
            this.basePath = hostingEnvironment.ContentRootPath; 
            this.operation = new PhysicalFileProvider(); 
            this.operation.RootFolder(this.root); 
        } 
} 
 
 
 
Please, refer to the below link for FileManager component. 
 
 
 
 
Please let us know, if you need any further assistance. 
 
Regards,  
Sowmiya.P 


Marked as answer
Loader.
Up arrow icon