Delete files from subfolders

3 posts, 1 answers
  1. onur
    onur avatar
    4 posts
    Member since:
    Mar 2009

    Posted 06 Aug 2009 Link to this post

    Hi,
    I trying to let users to delete files from subfolders but Only root level files are deletable. This is my code,


    **********
    string p1 = "~/Reports";
    string p2 = p1 + "/Images";
    string p3 = p1 + "/Documents";
    var PathsRoot = new[] {p1};
    var PathsAll = new[] { p1,p2,p3 };
    RadFileExplorer1.Configuration.ViewPaths = PathsRoot;
    RadFileExplorer1.Configuration.UploadPaths = PathsAll;
    RadFileExplorer1.Configuration.DeletePaths = PathsAll;
    ***************

    if i use "PathsAll" for ViewPaths the RadFile Explorer shows 2 Images folder and 2 Documents folder.
    How can i let users to delete files from subfolders ?

     

     

     

     

  2. Answer
    Fiko
    Admin
    Fiko avatar
    1406 posts

    Posted 07 Aug 2009 Link to this post

    Hi Onur,

    This is the expected behavior, because you set an array of 3 paths to the ViewPaths property. Respectively the FileExplorer control will explore these path in the Tree as different root folders.
    I am not quite sure what is your requirement but bellow I placed an example configuration and explanation of the RadFileExplorer's behavior in this case:
     
    string p1 = "~/Reports";  
    string p2 = p1 + "/Images";  
    string p3 = p1 + "/Documents";  
    string[] viewPath = new string[] { p1 };  
    string[] deleteAndUploadPath = new[] { p2, p3 };  
    RadFileExplorer1.Configuration.ViewPaths = viewPath;  
    RadFileExplorer1.Configuration.UploadPaths = deleteAndUploadPath;  
    RadFileExplorer1.Configuration.DeletePaths = deleteAndUploadPath; 

    This configuration assigns the following permissions to the folders :

    •  "~/Reports" is explored and it is visible including all of its subfolders
    • "~/Reports/Images" and "~/Reports/Documents" folders are upload destinations. Also the folders/files inside these folders can be deleted.
    • All of the paths that are outside of the above mentioned permissions are invisible or they are visible but the folders/files inside cannot be deleted. Upload is not allowed as well.

    I hope this information helps.

    Regards,
    Fiko
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. onur
    onur avatar
    4 posts
    Member since:
    Mar 2009

    Posted 07 Aug 2009 Link to this post

    Ok, Now it's clear,
    File delete problem fixed by putting RadFileExplorer Paths configuration codes on pageLoad.

    Thanks for your answer
    Have a good day
Back to Top