Link to home
Start Free TrialLog in
Avatar of Arikkan
ArikkanFlag for United States of America

asked on

Need to use Physical Path on RadFileExplorer

I am using a solution with "radFileExplorer" used in the controls.
Here I was passing a virtual path that works just fine.

But when I added a network path to a Mapped Drive and used it in the "radFileExplorer ", it throws a run-time exception.
Any ideas guys on how to use the physical path correctly here?
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


        protected void Page_Load(object sender, EventArgs e)
        {
            radFileExplorer1.Enabled = false;
            try
            {
                   //radFileExplorer1.InitialPath = Page.ResolveUrl("~/FoldersAndFiles");
                    radFileExplorer1.DisplayUpFolderItem = true;
                    radFileExplorer1.EnableOpenFile = true;
                    radFileExplorer1.AllowPaging = true;
                    radFileExplorer1.EnableCreateNewFolder = true;
                   
                    if (IsSuperUser() == true)
                    {
                        radFileExplorer1.EnableCreateNewFolder = true;
                    }
                    else
                    {
                        radFileExplorer1.EnableCreateNewFolder = false;
                        RemoveControlsFromFileExplorer("Delete");
                        RemoveControlsFromFileExplorer("Rename");
                    }
                    radFileExplorer1.VisibleControls = GetVisibleControls();  //Get the visible controls for the FileExplorer
                    radFileExplorer1.ExplorerMode = Telerik.Web.UI.FileExplorer.FileExplorerMode.Thumbnails;
                    radFileExplorer1.ExplorerMode = Telerik.Web.UI.FileExplorer.FileExplorerMode.Default;
                    radFileExplorer1.Configuration.AllowMultipleSelection = true;
                    radFileExplorer1.Configuration.MaxUploadFileSize = 1 * Constants.GigaByte;

                    InitializePageBasedControls();
                    radFileExplorer1.Enabled = true;
            }
            catch (Exception ex)
            {
                ShowException("Error:" + ex.Message);
                radFileExplorer1.Enabled = false;
            }
        }


        //Initialize the File Locations (Download/View/Delete) for the Current page
        private void InitializePageBasedControls()
        {
            string[] uploadPaths = new string[] {};
            string[] viewPaths = new string[] {};
            string[] deletePaths = new string[] {};

            //Set the paths as needed (Not working - Physical Paths)
            uploadPaths = new string[] { "R:\DataFolder\Upload" };
            viewPaths = new string[] { "R:\DataFolder\View" };
            deletePaths = new string[] { "R:\DataFolder\Delete" };

            //Set the paths as needed (Working - Relative Paths)
            //uploadPaths = new string[] { "~\FoldersAndFiles\Upload" };
            //viewPaths = new string[] { "~\FoldersAndFiles\View" };
            //deletePaths = new string[] { "~\FoldersAndFiles\Delete" };

            radFileExplorer1.Configuration.UploadPaths = uploadPaths;
            radFileExplorer1.Configuration.ViewPaths = viewPaths;
            radFileExplorer1.Configuration.DeletePaths = deletePaths;
      }
Error1.png
ASKER CERTIFIED SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Arikkan

ASKER

I tried with this method in 2 ways:

1. Mapped drive on a network folder:  >>   R:/Repository/FolderMapped/
--> Here I can see only the ROOT folder on the control and nothing else. Cannot view/write anything (On root) and cannot see any subfolders.


2. Shared network folder:  >>   \\myComputerDesktop2\Repository\FolderShared\
--> Here the whole radFileExplorer control is greyed out. Cannot see anything on it.
--> Just to check, I have given full control to Everyone (In Properties and Shares as well). But still cannot do anything on the folder....

Any ideas?
If your original problem is solved (which it seems to be) then please close this question and ask a new one about the now very different problem.
Avatar of Arikkan

ASKER

Not really. I cannot view the files on the Absolute path.
>>But when I added a network path to a Mapped Drive and used it in the "radFileExplorer ", it throws a run-time exception.