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

Delete and Upload buttons appear disabled

2 Answers 92 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Burbank
Top achievements
Rank 1
Burbank asked on 27 May 2010, 08:06 AM
Hello,

I am trying to figure out why the upload and delete buttons appear disabled(greyed out) on my FileExplorer. I am using a custom file content provider.I have set up the upload and delete paths in the code behind. I have also enabled the viewstate. Can someone please advise as to what else needs to be set for the buttons to be enabled.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Christian
Top achievements
Rank 1
answered on 01 Jun 2010, 10:32 AM
Hi Burbank!

I just had the same problem. Now it works like a charm!

I'm also use the content provider to filter some filetypes out like .skin-files.
My problem with upload/delete was that my delete- and uploadpaths was wrong. Can you share some code?

Here's some of mine:

string[] applicationName = new string[] { this.ResolveUrl("~/App_Themes/Standard/") }; 
string[] allowedUploadPaths = new string[] { "~/App_Themes/Standard/css/", "~/App_Themes/Standard/images/" }; 
string[] allowedDeletePaths = GetAllowedDeletePaths(); 
 
rfeFileExplorer.Configuration.ViewPaths = applicationName
rfeFileExplorer.Configuration.DeletePaths = allowedDeletePaths
rfeFileExplorer.Configuration.UploadPaths = allowedUploadPaths

This way I see all content of App_Themes/Standard (applicationName) in my FileExplorer.
Create folder and upload are enabled in App_Themes/css and /images (allowedUploadPaths).
Finally the GetAllowedDeletePaths method returns an array of all contents (just folders) in /css and /images (i.e "~App_Themes/Standard/css/layout", "~App_Themes/Standard/images/buttons"). This is because I dont want the delete-button to be enabled so that I can delete whole css or images folder, just it's content folders.

I hope this was to some help!

Regards

Christian Persson



0
Fiko
Telerik team
answered on 01 Jun 2010, 01:26 PM
Hello Burbank,


You can set different permission to a folder by passing the desired permission to the constructor of the DirectoryItem. For instance, you can give a folder Delete permission by using this constructor:
Copy Code
Copy Code
DirectoryItem directoryWithReadAndDeletePermissions =
new DirectoryItem(foldername, foldername, fullpath, string.Empty, PathPermissions.Read | PathPermissions.Delete, new FileItem[0], new DirectoryItem[0]);

In addition, I recommend you to override the CheckWritePermissions and CheckDeletePermissions (if exist) methods as well.

Kind regards,
Fiko
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
FileExplorer
Asked by
Burbank
Top achievements
Rank 1
Answers by
Christian
Top achievements
Rank 1
Fiko
Telerik team
Share this question
or