Image Files

4 posts, 0 answers
  1. Qusay
    Qusay avatar
    2 posts
    Member since:
    Sep 2016

    Posted 26 Sep Link to this post

    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.
  2. Rumen
    Admin
    Rumen avatar
    12849 posts

    Posted 27 Sep Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Qusay
    Qusay avatar
    2 posts
    Member since:
    Sep 2016

    Posted 27 Sep in reply to Rumen Link to this post

    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

  5. Rumen
    Admin
    Rumen avatar
    12849 posts

    Posted 29 Sep Link to this post

    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.
Back to Top