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

Cannot write to the Target Folder !

14 Answers 268 Views
Editor
This is a migrated thread and some comments may be shown as answers.
kiran
Top achievements
Rank 1
kiran asked on 29 Apr 2009, 07:37 AM
Hi Friends,

    Can anyone help me why is this alert message "Cannot write to the Target Folder !"
    displayed when i use Image Editor to resize the image and try to save the file.
    and is there any option to fix this up..

Thanks


    

14 Answers, 1 is accepted

Sort by
0
Lini
Telerik team
answered on 29 Apr 2009, 02:26 PM
Hi,

Are you using a custom content provider? If you are, then you have experienced a known bug in the 2009.1 402 RadControls build. It will be fixed in the next service pack release. If you want to get the fix earlier, please open a formal support ticket.

If you are not using a custom content provider, then please check if you have set the UploadPaths for the image manager dialog correctly. If you have only set ViewPaths, you will not be able to upload new or change files in the Image Manager and Image Editor dialogs.

All the best,
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
kiran
Top achievements
Rank 1
answered on 30 Apr 2009, 05:07 AM
Thanks for telerik team for faster reply...


Thanks
0
Ryan
Top achievements
Rank 1
answered on 30 Apr 2009, 01:56 PM
I just ran into the same issue. Do you know when the next release will be?

Thanks,

Ryan
0
Rumen
Telerik team
answered on 04 May 2009, 11:15 AM
Hi Ryan,

The release date of SP2 is not yet decided, but you can expect it after the middle of May' 2009.


Sincerely,
Rumen
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
QScend
Top achievements
Rank 1
answered on 05 May 2009, 04:34 PM
We have the same problems with builds 428, 429 and 430 (the most current). How has this been a bug since build 402 and still not reached the internal builds as a fix? Opening a support ticket because we absolutely must deploy an update to our customers to fix this issue.
0
Rumen
Telerik team
answered on 08 May 2009, 06:17 AM
Hi Keith,

I attached the latest available internal build of RadEditor v.2000.1.507 to your support ticket. I was not able to reproduce the problem with it. Could you please test it and let us know if you still experience the problem?

Kind regards,
Rumen
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
QScend
Top achievements
Rank 1
answered on 08 May 2009, 02:20 PM
Build 507 fixed this for us, thanks.
0
F19
Top achievements
Rank 1
answered on 15 May 2009, 12:29 PM
Hi,

I´m implementing a CustomFileProvider and ran into this same issue. Everything so far is working fine (listing files, uploading, previewing, inserting them into the editor and deleting), but when using the Image Editor the ´Save´ button consistently generates this error message ´Cannot write to the target folder!´

I switched from the official 2009 SP1 release to the latest development build (514) but that didn´t fix the issue.

In the debugger I can see my constructor is called after pushing the ´Save´ button, but after that the exception occurs before any of the other implemented functions is hit.

Is this a regression on your end?

Cheers, Wouter



0
Lini
Telerik team
answered on 18 May 2009, 07:10 AM
Hi Wouter,

Have you set the UploadPaths property and is the current folder (where the edited image is) included in the UploadPaths? Try Setting UploadPaths="/". This should allow upload in all folders.

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
F19
Top achievements
Rank 1
answered on 18 May 2009, 07:39 AM
Thanks for the reply. It was my bad; I only updated the .dll to 514, but apparently your bugfix needed the newer EditorDialogs as well.

Cheers, Wouter

0
Suneco
Top achievements
Rank 2
answered on 12 Jun 2009, 11:29 AM

Hello Telerik,

According to Lini's post

Out of Lini's message i understand that in Telerik "v2009.1.527.35" (which i use) this bug has to be solved. As I use a CustomContentProvider I still get the "Cannot write to the Target Folder!" error message.

The code block below shows you how I configured my ImageEditor

FileManagerDialogParameters imageEditorParameters = new FileManagerDialogParameters();  
imageEditorParameters.FileBrowserContentProviderTypeName = typeof(Sunnova.Web.UI.Controls.SunnovaFileStreamContentProvider).AssemblyQualifiedName;  
imageEditorParameters.ViewPaths = new string[] { "/app_files" };  
imageEditorParameters.UploadPaths = new string[] { "/app_files" };
imageEditorParameters.MaxUploadFileSize = 5000000;  
 
DialogDefinition imageEditor = new DialogDefinition(typeof(ImageEditorDialog), imageEditorParameters);  
imageEditor.Width = Unit.Pixel(832);  
imageEditor.Height = Unit.Pixel(540);  
 
_dialogOpener.DialogDefinitions.Add("ImageEditor", imageEditor); 

Thanks in advance,
Jeroen Speldekamp
0
Lini
Telerik team
answered on 15 Jun 2009, 02:26 PM
Hello Jeroen,

I am not sure what is the problem in your case, but I have a couple of suggestions:

1) try modifying your View/Upload paths and see if it makes a difference. You can try adding a slash at the end of the path ( "/app_files/") or you can try changing the UploadPaths to a simple  "/".

2) If you are using version 2009.1.527 or later, you can override the CheckWritePermissions() method from the base content provider class and implement your own logic for checking if a folder should have Upload permissions. The "Cannot write to the Target Folder!" error is raised because this method returned false at some point during the save operation.

If both of these fail, you can open a formal support ticket and send us a sample project, so we can investigate further.

Greetings,
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
sculver
Top achievements
Rank 1
answered on 13 Jan 2010, 02:49 PM
I am having this same issue, except with the 2009 Q3 release.

I am using a custom Provider, which runs off an existing DB.  The "Paths" I am sending in are Guid (on purpose) and this approach works for the ImageManger, which I setup using code exactly like this.... its just for the Editor, I get the "Cannot write to the Target Folder!".  I noticed that when I ran this code, it was NOT calling any methods in the CustomProvider before it called this?  Isn't it supposed to?? What might I be doing wrong?

FileManagerDialogParameters imageEditorParameters = new FileManagerDialogParameters(); 
        imageEditorParameters.ViewPaths = new string[] { "A8A492A1-7381-4690-847E-75F98E24AFA4" }; 
        imageEditorParameters.UploadPaths = new string[] { "A8A492A1-7381-4690-847E-75F98E24AFA4" }; 
        imageEditorParameters.DeletePaths = new string[] { "A8A492A1-7381-4690-847E-75F98E24AFA4" }; 
        imageEditorParameters.MaxUploadFileSize = 5000000; 
        imageEditorParameters.FileBrowserContentProviderTypeName = typeof(CustomImageManagerProvider).AssemblyQualifiedName; 
         
        DialogDefinition imageEditor = new DialogDefinition(typeof(ImageEditorDialog), imageEditorParameters); 
        imageEditor.Width = Unit.Pixel(832); 
        imageEditor.Height = Unit.Pixel(520); 
        doImageDialogSmall.DialogDefinitions.Add("ImageEditor", imageEditor); 
        doImageDialogLarge.DialogDefinitions.Add("ImageEditor", imageEditor); 



0
Liu Peng
Top achievements
Rank 1
answered on 18 Jan 2010, 04:46 AM
Hi Sculver:

I have the same problem with you, after analyze the RadEditor's source code I know that we must override the CheckWritePermissions, the following is the RadEditor's original code:
/// <summary> 
/// Checks if the current configuration allows writing (uploading) to the specified folder 
/// </summary> 
/// <param name="folderPath">the virtual path that will be checked</param> 
/// <returns>true if writing is allowed, otherwise false</returns> 
public virtual bool CheckWritePermissions(string folderPath) 
    //add a ending slash to the upload folder 
    folderPath = folderPath.TrimEnd(PathSeparator) + PathSeparator; 
 
    //compare the upload folder to all paths in the UploadPaths collection and check if it is a child or one of them. 
    //Paths are case-sensitive! 
    foreach (string uploadPath in UploadPaths) 
    { 
        if (!String.IsNullOrEmpty(uploadPath) && folderPath.StartsWith(uploadPath)) 
        { 
            //remove trailing slash from upload path 
            string trimmedUploadPath = uploadPath.TrimEnd(PathSeparator); 
            if (trimmedUploadPath.Length == 0) 
            { 
                //empty upload path - give permissions everywhere 
                return true
            } 
            if (folderPath.Length > trimmedUploadPath.Length && folderPath[trimmedUploadPath.Length] == PathSeparator) 
            { 
                return true
            } 
        } 
    } 
    return false

My override is this:
public override bool CheckWritePermissions(string folderPath) 
    return true

Regards,
LP
Tags
Editor
Asked by
kiran
Top achievements
Rank 1
Answers by
Lini
Telerik team
kiran
Top achievements
Rank 1
Ryan
Top achievements
Rank 1
Rumen
Telerik team
QScend
Top achievements
Rank 1
F19
Top achievements
Rank 1
Suneco
Top achievements
Rank 2
sculver
Top achievements
Rank 1
Liu Peng
Top achievements
Rank 1
Share this question
or