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

call custom FileBrowserContentProvider from ImageEditor.ascx

6 Answers 166 Views
FileExplorer
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 12 Jun 2009, 08:53 PM

I have implemented a custom FIleBrowserContentProvider successfully, and have it working with RadEditor.

Is there a way to cause the ImageEditor's Save functionality call a custom FileBrowserContentProvider?

Looks like the 'cannot write to folder' alert is getting hit in the _saveButtonClickHandler in ImageEditor.ascx:

 

var name = this.get_newImageName()+$get("NewImageExt").innerHTML;

 

 

if (!name || name.indexOf(separator) != -1)

 

{

alert(localization[

"MessageCannotWriteToFolder"]);

 

 

return;

 

}

I have not made any changes to any of this code.

Suggestions?

6 Answers, 1 is accepted

Sort by
0
Lini
Telerik team
answered on 15 Jun 2009, 11:34 AM
Hello Jon,

Please update to the latest official release of the RadControls for ASP.NET AJAX (version 2009.1.527). It features a number of fixes for the Image Manager/Image Editor dialogs and custom content providers. Also, make sure that you have set the UploadPaths in the dialog definitions of the Image Manager/Editor. If the UploadPaths is empty, the dialogs will alert "Cannot write to target folder" when you attempt to upload/save files. To allow writing in all folders of your custom content provider, simply set the UploadPaths to "/".

Kind regards,
Lini
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.
0
Jon
Top achievements
Rank 1
answered on 15 Jun 2009, 04:15 PM
Lini,

ImageEditor with my content provider now works with 2009.1.527.35.

Thanks!
0
Laku
Top achievements
Rank 1
answered on 22 Jul 2009, 05:56 PM
Hello,

I'm updating telerik library to the latest version. Image upload worked fine with older version of the library. I'm using custom FileBrowseContent provider and have never faced this issue before. Now I've upgraded to version 2009.2.701.20 and started to get this error.  Accoring to answers in the theard I have set Upload paths to "/".  But that is not solving the problem. Please help to solve the issue.

I have also tried latest hot fix version 2009.2.720.20 with no luck.

Thanks!
0
Laku
Top achievements
Rank 1
answered on 22 Jul 2009, 07:54 PM
I looked more in the issue and found out that there is a problem with method "public override DirectoryItem ResolveRootDirectoryAsTree(string path)". If I set full path of the return DirectoryItem object to the folder where I store files, upload works fine. But this brings up another issue. The full path now shows up in the path text box of the imageManager window. I don't want users to see where files are stored. Instead I would like to show something like "\Images\" in the path field. I used to do that by returning DirectoryItem objects with path set to "\Images\". I can't do that anymore because it breaks the image upload functionality.
 
I do not understand why setting "\Images\" as directory path breaks image upload.  I believe it should not matter what path I set in the root DirectoryItem because all the logic to get files and folders and save new files should be handled by my custom FIleBrowserContentProvider.  But what I see is that StoreFile method of the  custom FIleBrowserContentProvider is not even invoked.
 
 Any suggestions how to fix this?
0
Lini
Telerik team
answered on 27 Jul 2009, 08:52 AM
Hello,

Since you have a custom content provider, I can suggest the following workaround - override the CheckWritePermissions function from the base content provider class and always return true. The "Cannot write to target folder" message is displayed only when CheckWritePermissions returns false. If that does not solve the problem, please open a formal support ticket and send us a sample project with your content provider. Once we see the problem, we will provide you with a valid workaround.

Regards,
Lini
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.
0
Laku
Top achievements
Rank 1
answered on 27 Jul 2009, 04:02 PM
Thanks, this solves the issue.
Tags
FileExplorer
Asked by
Jon
Top achievements
Rank 1
Answers by
Lini
Telerik team
Jon
Top achievements
Rank 1
Laku
Top achievements
Rank 1
Share this question
or