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

server-side save with canvas=yes

4 Answers 100 Views
ImageEditor
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 23 Feb 2013, 08:44 AM
Hi

I need to save an edited image server-side in an SQL database. Apparently this does not work correctly with CanvasMode set to 'yes', but I need this set to yes as I am using the new Drawing tools!

Could you please help me achieve this. Is there a way I can successfully retrieve the edited image server-side while using the drawing tools, if not could you help provide me with a work around that perhaps retrieves the edited image client-side and then executes a server-side function that can reference the retrieved image (i.e. client-side place the image contents in a server control, and then call a server side function to save it in a database)?

Any help would be much appreciated.

Regards, Paul

4 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 25 Feb 2013, 12:20 PM
Hi Paul,

I have already answered your support ticket on the subject, for convenience I am pasting my answer here as well:

You could try using the ImageEditor's applyChangesOnServer() method, which would force the changes made to the image to be applied on the server.

If this does not help you in solving the case - could you prepare a sample fully runnable project reproducing the issue, allowing us to examine and debug the problem locally?


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
Paul
Top achievements
Rank 1
answered on 26 Feb 2013, 10:18 AM
Hi
Unfortunately, applyChangesOnServer() does not work.

Simple to reproduce the problem, add asp.net button and server-side code behind click as follows:
 

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click

Me.RadImageEditor1.SaveEditableImage("myImage", True)

 

End Sub

...Nothing is saved.


Regards, Paul
0
Vessy
Telerik team
answered on 01 Mar 2013, 09:08 AM
Hi Paul,

Please, excuse me if I was not clear enough in my previous reply - the applyChangesOnServer() works properly in enabled CanvasMode only if its arguments are also configured to save the image on the server:
  • saveImageServer (type='Boolean') - if the image is to be saved on the server
  • filename (type='Object') - The filename of the image. If null then the original filename is used. If file name is not a string, but an object of format {name: "fileName", ext: "png"}, this method will change the extension of the saved image.
  • call_saveOnClient (type='Boolean') - if the image is to be downloaded on the client machine after the operations have been applied to the client.
  • overwrite (type='Boolean') - if the image is to be overwritten on the server.

When you edit the image in CanvasMode, the only way to apply the changes from the edited canvas object to the server image is to save the image from the client. If you use directly any of the server methods (like RadImageEditor1.SaveEditableImage("myImage", True)) the newly created image would be a copy of the original image (without the changes).

All the best,
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
Paul
Top achievements
Rank 1
answered on 01 Mar 2013, 09:56 AM
Hi Vesi

Yes, I can successfully save the edited image with that method, Thanks for your help. It was confusing because there is a server-side save function which works but ignores any canvas activity, and that is not explained in the documentation, but I guess the idea is to make that also work in time?

Regards, Paul
Tags
ImageEditor
Asked by
Paul
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Paul
Top achievements
Rank 1
Share this question
or