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

Hiding or Disabling "Upload" button using RadFileExplorer

1 Answer 92 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Gean
Top achievements
Rank 1
Gean asked on 17 Oct 2013, 06:35 AM
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

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 22 Oct 2013, 07:01 AM
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" />
</telerik:RadFileExplorer>

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/"

Regards,
Veselina Raykova
Telerik
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.
Tags
FileExplorer
Asked by
Gean
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or