This is a migrated thread and some comments may be shown as answers.

Explore files from c drive

3 Answers 190 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 15 Mar 2011, 10:37 PM
Hi guys
I am using file explorer to select the location to create an sql backup in c sharp. I want to explore file and folders in c drive and other drives. How is it possible?.
I use

string[] viewPaths = new string[]
                {                  
                   @"~/"
                };

FileExplorer1.Configuration.SearchPatterns = new[] { "*.bak" };
FileExplorer1.Configuration.ViewPaths = viewPaths;


in page load, in this way I can only explore from root of the project.
I want to explore C: and others drives.
Anybody can help me?
Thanks
Ben

3 Answers, 1 is accepted

Sort by
0
Dobromir
Telerik team
answered on 16 Mar 2011, 11:39 AM
Hi Ben,

To achieve the required result you need to implement a custom filebrowser content provider to the RadFileExplorer. A detailed information on on the subject in the following help article and live demo:
Using custom FileBrowserContentProvider
FileExplorer / Custom File Content Provider

Also, in this KB article you can find a custom content provider that works with physical and network shared folders.

Kind regards,
Dobromir
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Ben
Top achievements
Rank 1
answered on 16 Mar 2011, 01:58 PM
Thanks
Those demos are so complicated, so can u simplify that functionality. I just want to browse physical drives thats it.
can you help me?
Ben
0
Dobromir
Telerik team
answered on 21 Mar 2011, 08:59 AM
Hi Ben,

In the KB article linked in my previous answer you can find a sample project implementing a custom content provider that allows to RadFileExplorer to work with paths of the physical drive. In order to implement this provider to you application please follow these steps:
  1. Copy the files from the example project's App_Code folder to your applications App_Code folder
  2. Copy the FileSystemHandler.ashx handler file to your application folder.
  3. Open the MappingFile.mapping file located in the App_Code folder and change the <genericHandlerPath>FileSystemHandler.ashx</genericHandlerPath>
    with the correct path to the FileSystemHandler.ashx from your application if needed - its current value indicates that the file is located in the application root folder
  4. Add <mapping> nodes to the MappingFile.mapping file describing the paths that you want to access with the RadFileExplorer following the pattern:
    • <PhysicalPath> node contains the physical path to the folder that should be loaded in RadFileExplorer - this path can be a path from a physical drive (e.g. C:\FolderName) or path to a shared folder (e.g. \\ServerName\FolderName)
    • <VirtualPath> node value is the name that will be displayed in the RadFileExplorer for this folder
  5. Register the custom content provider to the RadFileExplore:
    RadFileExplorer1.Configuration.ContentProviderTypeName = typeof(CustomFileSystemProvider).AssemblyQualifiedName;
  6. Set ViewPaths / UploadPaths / DeletePaths to point to desired physical folders, e.g.:
    string[] paths = new string[] { @"C:\FolderName\SubFolder" };
     
    RadFileExplorer1.Configuration.ViewPaths = paths;
    RadFileExplorer1.Configuration.UploadPaths = paths;
    RadFileExplorer1.Configuration.DeletePaths = paths;


All the best,
Dobromir
the Telerik team
Tags
FileExplorer
Asked by
Ben
Top achievements
Rank 1
Answers by
Dobromir
Telerik team
Ben
Top achievements
Rank 1
Share this question
or