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

Image Files

3 Answers 52 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Qusay
Top achievements
Rank 1
Qusay asked on 26 Sep 2016, 09:32 AM
I know that many other people have posted threads about this issue; however, non of them got my issue resolved. Well, I'm trying to send the content of RadEditor , which contains images (uploaded to a folder on the web server) to as an email (using GMail), but when the email is received, the image is unavailable. ContentFilters is set to "MakeUrlsAbsolute, DefaultFilters", SearchPatterns is set to "*.jpeg,*.jpg,*.png,*.gif,*.bmp". I've gove "Everyone" access to the folder where images are uploaded but this has not fixed the issue. When I inspected the<img> tag in the received email, I found out that the URL has been changed to "https://ci4.googleusercontent.com/proxy/" and some random letters before the actual URL. I'm not sure why this is happening and whether this is a GMail issue or RadEditor issue. Nothing online helped me to get this issue resolved.

3 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 27 Sep 2016, 10:42 AM

Hi Qusay,

The reported issue has nothing to do with RadEditor and is also widely discussed across the Net:


Best regards, Rumen
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Qusay
Top achievements
Rank 1
answered on 27 Sep 2016, 11:42 AM

Hi Rumen,

Thanks for your response. However, I've already checked those links and nothing helped. What I think would fix this issue is to include those images as attachments using something like the following code:

 

string imgPath = HttpContext.Current.Server.MapPath("~/images/myimage.png");
            Attachment image =  new Attachment(imgPath);
            msg.Attachments.Add(image);
            string contentID = "Image";
            image.ContentId = contentID;
            image.ContentDisposition.Inline = true;    //To make the image display as inline and not as attachment
            image.ContentDisposition.DispositionType = DispositionTypeNames.Inline;

 

I have done this with static images (that have not been uploaded through RadEditor) using the code above, but do not know how to do this through RadEditor. I need a way to loop through images used in the current RadEditor instance to get them as well as their location in the control in order to convert them into attachments and place them in the generated exactly how they originally looked. 

 

Thanks & Regards,

Qusay

0
Rumen
Telerik team
answered on 29 Sep 2016, 11:58 AM
Hi Qusay,

The content returned by the Content server property of RadEditor is a plain string. You can parse it via a regular expression, locate all <img> src attribute values and supply them as a parameter of the MapPath method of your code:


string imgPath = HttpContext.Current.Server.MapPath(supply the img src here);


Best regards,
Rumen
Telerik by Progress
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Editor
Asked by
Qusay
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Qusay
Top achievements
Rank 1
Share this question
or