call custom FileBrowserContentProvider from ImageEditor.ascx

7 posts, 0 answers
  1. Jon
    Jon avatar
    26 posts
    Member since:
    Apr 2009

    Posted 12 Jun 2009 Link to this post


    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?

  2. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 15 Jun 2009 Link to this post

    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.
  3. Jon
    Jon avatar
    26 posts
    Member since:
    Apr 2009

    Posted 15 Jun 2009 Link to this post

    Lini,

    ImageEditor with my content provider now works with 2009.1.527.35.

    Thanks!
  4. Laku
    Laku avatar
    7 posts
    Member since:
    Sep 2007

    Posted 22 Jul 2009 Link to this post

    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!
  5. Laku
    Laku avatar
    7 posts
    Member since:
    Sep 2007

    Posted 22 Jul 2009 Link to this post

    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?
  6. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 27 Jul 2009 Link to this post

    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.
  7. Laku
    Laku avatar
    7 posts
    Member since:
    Sep 2007

    Posted 27 Jul 2009 Link to this post

    Thanks, this solves the issue.
Back to Top