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

Can not write to target folder with Image editor

4 Answers 122 Views
Editor
This is a migrated thread and some comments may be shown as answers.
shadow
Top achievements
Rank 2
shadow asked on 11 Dec 2012, 04:17 PM
Hello,

I am having several issues with ImageEditor.
Here is how I have configured it,
  • External Dialogs
  • CustomContentProvider
  • Uploading Images in directory instead of saving them in database.

Issues:
  • Can not save to target directory
  • Images are not refreshed in image manager after image is saved.

Scenario:
After editing some image when I click the save button, it gives the alert ("Can not save to target directory.") and after clicking the save button fourth time the message doesn't appear and image is saved, but now the Image is not refreshed in ImageManager. If I clear the browser cache then the edited image is displayed in image manager!!

Note:
My target folder is configured as a separate virtual directory. 
Reason for making it a separate virtual directory is that we have some other modules who manipulate files (upload/delete) which leads to user session time outs when they delete some file. We also want to keep user files away from our actual web due to the size of the project. But this virtual directory is under same domain as a sub domain.
e.g www.domain.com and files folder is www.domain.com/files/images


I am fighting with these issue now from last one month, explored several forum posts and tried what I have figured out... Can you please help me to fix these issues???



Thank you all.  

4 Answers, 1 is accepted

Sort by
0
shadow
Top achievements
Rank 2
answered on 11 Dec 2012, 04:41 PM
Empty string passed to getElementById().
@ http://mydomain.com/ScriptResource.axd?d=AfrmdD1RtOrZJScf_O8eoM3SZLo-QrJhLcs-8li7LJVw5eTu6KoR-fPIivwvkVkgxw3ar41IKO4FoYUbTghazR7c17zhKOunxUa7LNuPsZmUR9L8ZbwtbfgMeq9fiIkOmzVVdhUPWeMKE3IpmLtL9d7buo-NKMF1DMLblWePNHT5G_8OiFwKG9MLZH04XMYZ0&t=ffffffff940d030f:4230


Upon saving this error is generated in firefox..!!!
0
Accepted
Vessy
Telerik team
answered on 14 Dec 2012, 12:39 PM
Hi Farid,

The image-caching problem is not directly related to RadEditor but is a default browser behavior. You are not seeing the modified image because the browser is displaying a cached one - that is why we recommend to save the modified images under new name.

That behavior could be workarounded by appending some random string to the src portion of the img tag to each image which is used in the editor. For example, you can implement the extra random parameter to the image URL by modifying the line 300 of the dialogs code to match the following one:
var src = item.get_url() + "?rnd=" + Math.random();

In the following article you could find detailed information on how to modify RadEditor's built-in dialogs:
Customize Built-in Dialogs. However, this change will cause the dialog to download the image everytime an image is selected and will slow down the performance.

Regarding the issue with target folder, most probably is due to permission restrictions. Could you try the test from the following help article to check if the application have read / write permissions on the server:
http://www.telerik.com/help/aspnet-ajax/fileexplorer-general-troubleshooting.html

Unfortunately, I was not able to reproduce the problem that you have shared in your latest post. Most probably it is connected with the additional in your code so in order to be able to provide more to the point answer I will need to examine and debug it locally. Could you prepare a sample fully runnable project reproducing the issue? You could see how to isolate such in the following link: Isolating a problem in a sample project.

Regards,
Vesi
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Manoj
Top achievements
Rank 1
answered on 12 Jul 2013, 08:03 AM
Hi,

 The below code i have kept  for rad image editor . It is executing  but the problem is not saving the croped image in my target folder . It is saving  the actual image  in my folder.



 protected void RadImageEditor1_ImageSaving(object sender, ImageEditorSavingEventArgs e)
    {

        string imgeinfo = "~/ProfilePictures/" + filename ;
        e.Image.Image.Save(Server.MapPath(imgeinfo));
    }

Please help me...
0
shadow
Top achievements
Rank 2
answered on 12 Jul 2013, 09:53 AM
I was able to fix this issue, It was related to the browser cache as you said. 

Fix:  I am not sure if it was a good solution but it worked :P I am appending a query string after the name of the file for example 

image.png?id=1

And increasing this number every time user saves the image. It forces the browser to load new image every time ;)
Tags
Editor
Asked by
shadow
Top achievements
Rank 2
Answers by
shadow
Top achievements
Rank 2
Vessy
Telerik team
Manoj
Top achievements
Rank 1
Share this question
or