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

RadEditor Image Manager - force full web image path

6 Answers 432 Views
Editor
This is a migrated thread and some comments may be shown as answers.
John M
Top achievements
Rank 1
John M asked on 16 Jan 2012, 09:11 PM
In my site we allow users to create html emails.  We create HTML templates that users edit using the RadEditor.  Afterwards they download the edited HTML and send the email using their own system.  The problem I'm having is with the Image Manager.  A user will upload an image and insert into the HTML but when they download the HTML the image no longer works.  Looking at the HTML that was generated, the image path is relative which is why it doesn't work.  My question is, is there a way to use a URL instead of a relative file path?

Thanks!

6 Answers, 1 is accepted

Sort by
0
Kaushal
Top achievements
Rank 1
answered on 17 Jan 2012, 11:14 AM
Hi John,

Why don't you save this image at some temporary location by generating GUID for each image before sending the email! Now when user will receive the mail he/she will get html with that folder path of that image named GUID. I think that will be the better way.

Thanks,

Kaushal Jani
0
John M
Top achievements
Rank 1
answered on 18 Jan 2012, 12:01 AM
Kaushal,

Thanks you for the reply.  I do use guid-named images when I generated the HTML.  The issue is what to do when a user uploads their own image using the Image Manager inside of the RadEditor control.  It is the Image Manager control that gives images a relative path when they are inserted into the HTML.  I need to know how to force it to give a complete URL instead of just a relative path.

Thanks,

John
0
Rumen
Telerik team
answered on 18 Jan 2012, 02:40 PM
Hello,

You should enable the MakeUrlsAbsolute filter of RadEditor, e.g.

ContentFilters="DefaultFilters,MakeUrlsAbsolute"

or

RadEditor1.EnableFilter(Telerik.Web.UI.EditorFilters.MakeUrlsAbsolute);

It will make all src attributes in the editor content to have absolute URLs. You can test the MakeUrlsAbsolute filter in the Built-in Content Filters demo.

Kind regards,
Rumen
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
John M
Top achievements
Rank 1
answered on 18 Jan 2012, 09:16 PM
That did the trick, Thanks!
0
Giancarlo
Top achievements
Rank 1
answered on 06 Nov 2013, 04:18 PM
I want to change only image src to absolute path.

There is some method to force absolute path for only image source and not for href source?

best regards
0
Ianko
Telerik team
answered on 08 Nov 2013, 11:36 AM
Hello Giancarlo,

I have answered you to this question in you opened support thread. Please, let us continue the conversation from there.

For anybody interested on this subject, the desired functionality could be achieved by implementing a custom content filter, which does the logic to preserve or convert the src and href attributes with the desired logic. 

Regards,
Ianko
Telerik
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 the blog feed now.
Tags
Editor
Asked by
John M
Top achievements
Rank 1
Answers by
Kaushal
Top achievements
Rank 1
John M
Top achievements
Rank 1
Rumen
Telerik team
Giancarlo
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or