Explore files from c drive

4 posts, 0 answers
  1. Ben
    Ben avatar
    20 posts
    Member since:
    Sep 2010

    Posted 15 Mar 2011 Link to this post

    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
  2. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 16 Mar 2011 Link to this post

    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!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ben
    Ben avatar
    20 posts
    Member since:
    Sep 2010

    Posted 16 Mar 2011 Link to this post

    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
  5. Dobromir
    Admin
    Dobromir avatar
    1633 posts

    Posted 21 Mar 2011 Link to this post

    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
Back to Top