Hiding or Disabling "Upload" button using RadFileExplorer

2 posts, 0 answers
  1. Gean
    Gean avatar
    2 posts
    Member since:
    May 2012

    Posted 17 Oct 2013 Link to this post

    I have a problem with regards on hiding  or Disabling "Upload" toolbar

    Here is the scenario:

    I have a Parent Folder - Folder 1
    and a Child Folder - Folder 2
    and a Child Sub-Folder - Folder 3

    What I want to achieve is
    Hide or Disable the upload button on Parent folder and Child Sub-folder
    and the user can upload files inside Child Folder

    but I don't know how can I achieve this.

    Thank you very much.
    Hoping for your reply soon
  2. Vessy
    Vessy avatar
    2163 posts

    Posted 22 Oct 2013 Link to this post

    Hi Gean,

    You can configure the folders where the user will be able to upload files, by setting the paths to them to the FileExplorer's Configuration's UploadPaths property. For instance, if the "Folder 1" is placed directly in you application root, you can configure it in a  similar way:
    <telerik:RadFileExplorer ID="RadFileExplorer2" runat="server">
        <Configuration ViewPaths="~/Folder 1" UploadPaths="~/Folder 1/Folder 2" />

    With the above configuration, the users will be able to see the files in Folder 1, and to upload files in Folder 2 and all of its subfolders. By design, FileExplorer does not provide a functionality to give permissions only to a specific folder, the are inherited by all of its children (if any).

    A way to restrict the upload in Folder 3 is
     - subclass the FileSystemContentProvider, by overriding its CheckWritePermissions() method
     - check in the override whether the current  path starts/contains (depending on your custom logic) with "Folder 2/"

    Veselina Raykova
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top