I’m having troubles getting RadFileExplorer to work. Listing files works fine, and viewing also, but uploading and deleting doesn’t work at all.
If I try to delete a file, I first get an error in Visual Studio in a script file loaded from a web resource (Telerik.Web.Resource.WebResource_2.axd), in _callWebService:function(_13,_14,_15), on line 29:
The error is ‘Microsoft JScript runtime error: 'this._folderCache' is null or not an object’. If I continue, I get the following response: The selected file could not be deleted because the application did not have enough permissions. Please, contact the administrator.
I’m running it from Visual Studio, using the Development Web Server, and I have Full Control rights in the directory I want to delete a file from. I also tried running Visual Studio as Administrator, which made no difference. After the error, my upload button also mysteriously disappears.
If I try to upload a file, I get no error in Visual Studio, but I get the following response in my page: E:ErikDownloadstest.jpeg : Cannot write to the target folder!
My RadFileExplorer is declared as follows:
<telerik:RadFileExplorer runat="server" ID="FileExplorer" DisplayUpFolderItem="False" Skin="Office2007" VisibleControls="Grid, Toolbar, ContextMenus">
<Configuration SearchPatterns="*.jpg,*.png,*.gif,*.css,*.htc,*.jpeg,*.bmp" />
In code-behind, the only interaction with the control is setting the ViewPaths, DeletePaths and UploadPaths, all set to the same single path, formatted as a virtual path, ending in a forward slash.
My page uses a RadScriptManager and contains an UpdatePanel, but that doesn’t seem to be the issue; the FileExplorer causes errors whether I have the UpdatePanel on the page or not.
I'm running the latest build.
Hope somebody has some suggestions.
11 Answers, 1 is accepted
about your paths - did you set it somehow like this:
I use this setting - and it works without problems.
Maybe you want to take a look at my sample here:
It does a bit more - but I guess it can point you in the right direction.
But anyhow - this "E:ErkicDownloa..." makes me think that you made a mistake in path definition.
Could you post your code setting the paths please?
Or set them (if possible) in ASPX instead of doing this in code behind.
I used your code and prepared a test project, but I was not able to reproduce the error on my side. It looks like the issue is related to the paths that you set in the codebehind.
Please note that, by design, the RadFileExplorer control works only with virtual paths. That being said the folders should be in your application's root folder. In case if you need to use folders that are out of the application, you need to use a custom FileBrowserContentProvider as showed in this online demo.
For your convenience I have attached my demo to this thread. Could you please check it and let me know if it helps?
In case that you still experience the problem, please modify the project, open a new support ticket and send it back. Once we have a better view over your exact setup we will do our best to provide a solution.
the Telerik team
Thanks for your suggestions.
The problemwas caused by not properly setting the paths. They were in the correct format,but they were only set (in code-behind) on non-postback requests. A suggestionto Telerik might be to validate that all paths are set when an event occurs andthrowing an appropriate exception if they are not; the error I got was veryconfusing.
By any chance, have you disabled the RadFileExplorer's ViewState? If you have, please turn it back on and you shouldn't have to set the configuration paths after postback.
The ViewState is disabled in the FileExplorer's default example, because it allows us to showcase the VisibleControls property. There is no need to disable it in a normal scenario. We will fix the default example for the next release so people that use it as a base will not get confusing errors when trying to upload files.
the Telerik team
We have fixed a problem with loading the file explorer configuration from the ViewState. The fix will be included in the next service pack release and the next internal build (check the release notes). I hope that it will address the problem you are having as well.
All the best,
the Telerik team
I have a behavior like this : can't delete files, but I can upload files. I am using 2009 Q2.
I have coded my own FileBrowserContentProvider and all worked fine in 2009 Q1.
I will check using internal builds.
I think i have the solution for the problem. You must set the Configuration.DeletePaths property on the FileExplorer.
For some reasons the attachment did not make it through. In your case, however, the problem is different and it is related to a problem in the recent version (2009.3 1208) of the RadFileExplorer control. The unexpected behavior that you experience appears when the InitialPath property of the control is set before the ViewPaths, DeletePaths and UploadPaths ones. You can avoid the issue by moving the IitialPath assignment at the end of the code.
Your code should looks like this:
In case that you still experience the problem, please open a new support ticket and send me a runnable project that reproduces the problem and I will do my best to provide a solution as soon as possible.
I hope this helps.
the Telerik team