Streaming html with images

Hi there!
I am having some trouble with Data Service that I have created, what it basically does is use templates to generate an HTML page by replacing placeholders and fitting sections together depending on the criteria.
One template looks like this:
<html>
<head>
<meta http-equiv="refresh" content="60" />
<style type="text/css">
</style>
</head>
<body>
<div class="CSSTableGenerator" >
<table>
<tr>
<td>Kiron Interactive<img src="{EventCardImagePath}\Images\Kiron_Logo.png" alt="Mountain View"></td>
</tr>
<tr>
<td>Event Card for {EventCardDateDOW}, {EventCardDateDay}/{EventCardDateMonth}/{EventCardDateYear}</td>
</tr>
<tr>
<td>{EventCardEvents}</td>
</tr>
</table>
</div>
</body>
</html>
What I am having issues with is getting the image to display in the browser, the image is presented as 
{EventCardImagePath}\Images\Kiron_Logo.png
in the template, it can be any name or popular format (JPG or PNG)
Currently this is how I am returning the HTML string generated
/// <summary>
/// Method used to Get GSEvents and pass them to the formatter, HTML is then returned using current date
/// </summary>
/// <param name="eventType"></param>
/// <returns>HTML Event Card string</returns>
public System.IO.Stream HTMLEventCardUpcoming(string eventType)
try
//Compile DateTime
DateTime startTime = DateTime.Now;
DateTime endTime = DateTime.Now.Date;
endTime = endTime.AddDays(1).AddTicks(-1);
//Get the events
//Pass events to Adapter
EventCardFormatterAdapter eventform = new EventCardFormatterAdapter();
object htmlEventString;
bool htmlEventStringbool = eventform.TryFormatEventCard(events, startTime, EventCardFormatterAdapter.EventCardFormat.html, out htmlEventString);
string htmlString = htmlEventString.ToString();
byte[] resultBytes = Encoding.UTF8.GetBytes(htmlString);
WebOperationContext.Current.OutgoingResponse.ContentType = "text/html";
return new MemoryStream(resultBytes);
catch (Exception e)
Preferable I would like to be able to specify the local path of the image in the template that's whats currently being done, this is because the template is also used to generate PDFs and that needs the local path but thats working perfectly. Any ideas on
how I can accomplish this?
At the moment images are only working in IE
Thanks in advance

Hi
DaveGreen,
Based on your description, your case related to Web HTML. I am afraid that you posted in an inappropriate forum.  Please post in the related forum.
Here is the link
http://forums.asp.net
Thanks for your understanding.
Best regards,
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Mail not displaying emails in HTML - With images etc

    Recently aka the last couple of days all my mail accounts in mail have stoped showing all images and HTML coding, casically everything is in plain text.
    I have not changed any settings that I know of and if I log in on .mac the emails display properly with images etc.
    So far I have tried re-building the mail boxes and the display remote images in html option is selected in preferences.
    I would really appreciate it if anyone here can help me as plain text emailing is very annoying.
    Thanks, Luke

    DR T,
    Now that you have reported the results of your test with a New User Account, which you say was successful, we know it is not a problem with the application. You need to do the following:
    Quit Mail, and in the Finder open Home/Library and locate the Mail folder. Control-click over the Mail folder, and choose Duplicate -- then drag the resulting copy to the Desktop for temporary backup. Next, open Home/Library/Preferences and find the com.apple.mail.plist file and drag it to the desktop.
    Relaunch Mail, which will open as though new, and when prompted to import anything DECLINE. Instead, re-enter your account info, and Mail will re-discover the account folders for your accounts, and all should be well.
    Ask any needed questions, and keep us posted. It would appear your preferences, or something about your normal User Account are corrupt, or incorrect. This test a refresh of preferences, much like what you did when setting up the New User Account.
    Luke, this may not be what you need, but will do no harm. But please don't feel compelled to try this yet.
    Ernie

  • JavaMail - HTML with images - Images show up as both inline and attachment

    Hi,
    I am writing a program to send email which have
    1. HTML template which references images via the content-id mechanism
    2. A PDF document
    The mails are being rendered properly in Outlook, Gmail and Yahoo (the images show as inline and the PDF as attachment), however in hotmail the images are showing up as both inline and as attachment.
    When creating the email using JavaMail I am using the following structure
    ...multipart/mixed
    ......multipart/related
    ..........HTML Code
    ..........Images
    ......PDF file (as a MimeBodyPart)
    Is there something which I missed here or do I need to live with the way hotmail renders the email.
    Thanks.

    Yes the disposition is being setup correctly .. here is the dump of the mail (without the base64 encoded data)
    MIME-Version: 1.0
    Content-Type: multipart/mixed;
         boundary="----=_Part_0_17459938.1279571019577"
    ------=_Part_0_17459938.1279571019577
    Content-Type: multipart/related;
         boundary="----=_Part_1_13205705.1279571019612"
    ------=_Part_1_13205705.1279571019612
    Content-Type: text/html; charset='iso-8859-1'
    Content-Transfer-Encoding: 7bit
    HTML code here..
    ------=_Part_1_13205705.1279571019612
    Content-Type: image/jpeg
    Content-Transfer-Encoding: base64
    Content-Disposition: inline; filename=Img01.jpg
    Content-ID: <Img01>
    base64 dump here..
    ------=_Part_1_13205705.1279571019612
    Content-Type: image/jpeg
    Content-Transfer-Encoding: base64
    Content-Disposition: inline; filename=Img02.jpg
    Content-ID: <Img02>
    base64 dump here..
    ------=_Part_0_17459938.1279571019577
    MIME-Version: 1.0
    Content-Type: application/pdf; charset=ISO-8859-1; name="Test.pdf"
    Content-Transfer-Encoding: base64
    Content-Disposition: attachment; filename="Test.pdf"
    base64 dump here..
    ------=_Part_0_17459938.1279571019577--

  • HTML content with images and links blocked

    Hello,
    I very much need some help here because my company needs to send out newsletters to our clients in HTML format soon and so far the email with HTML content is being blocked as spam while text content works fine. Specifically, whenever I add a link or an image in HTML content, the email doesn't go through. I tried sending in multipart format but it is also not sending HTML with images and links. Here is my attempt:
                                    props.setProperty("mail.transport.protocol", "smtp");
                                     props.setProperty("mail.host", "mail.server.com");
                                     props.setProperty("mail.user", "joeuser");
                                     Session mailSession = Session.getDefaultInstance(props, null);
                                     mailSession.setDebug(true);
                                     Transport transport = mailSession.getTransport();
                                     MimeMultipart mp = new MimeMultipart("alternative");
                                     MimeBodyPart htmlPart = new MimeBodyPart();
                                     MimeBodyPart textPart = new MimeBodyPart();
                                     textPart.setText("Just to make it multipart");
                                     htmlPart.setHeader("MIME-Version", "1.0");
                                     htmlPart.setHeader("Content-Type", htmlPart.getContentType());
                                     htmlPart.setContent(strHtmlMessage, "text/html");
                                     mp.addBodyPart(textPart);
                                     mp.addBodyPart(htmlPart);
                                     MimeMessage message = new MimeMessage(mailSession);
                                     message.setHeader("MIME-Version", "1.0");
                                     message.setHeader("Content-Type", mp.getContentType());
                                     message.setHeader("X-Mailer", "Recommend-It Mailer V2.03c02");
                                     message.setContent(mp);
                                     message.setSubject(strSubject);
                                     message.setFrom(new InternetAddress("[email protected]"));
                                     message.addRecipient(Message.RecipientType.TO,
                                             new InternetAddress("[email protected]"));
                                             transport.connect();
                                             transport.sendMessage(message,
                                             message.getRecipients(Message.RecipientType.TO));
                                     transport.close();This code is one of my numerous attempts to make HTML send images and links. Please, let me know if there is a workaround way to make JavaMail send HTML with links and images in the message body. Your help will be greatly appreciated.

    The JavaMail FAQ has information on creating HTML messages, including
    messages with both plain text and HTML. Did you find it?
    BTW, your code has many unnecessary statements, such as setting
    the Mime-Version header, which JavaMail will do for you, and setting
    the Content-Type header, which JavaMail does as a side-effect of the
    setContent or setText calls.
    Other than that, it looks like your code should be correctly creating a
    multipart/alternative message. If the recipient is still rejecting it you
    need to figure out what it is about the message that makes the recipient
    think it's spam. Can you send a similar message using another mailer?
    Can you send the message to a different recipient?

  • Subfolders with images ??

    Hi!
    Is it possible to display subfolders as images in the "Sub-
    folders" region of a folder? Is there any workaround to do this?
    I have thougth that I can insert "text" elements (and insert
    pure html with images on each one) in another folder region
    instead of using the subfolders region, but it has to
    be "hardcoded" by each folder, and it is not very easy to
    mantain . .
    A better idea to do this? Any suggestions?
    Thanks anyway!!

    You can try a custom folder type, as described in
    Re: Date, calendar, Error on  page
    Regards,
    Jerry

  • How to send HTML mail with images multipart/related message

    Hi,
    Could any body tell me how to send HTML mail with images in "multipart/related" message,if any body can give the code ,it would be helpful.
    Thanks

    Hi,
    Could any body tell me how to send HTML mail with
    ith images in "multipart/related" message,if any body
    can give the code ,it would be helpful.
    ThanksHi!
    Refer to
    http://developer.java.sun.com/developer/onlineTraining/JavaMail/index.html
    I've found it very helpful.
    Look at the last part for a code showing how to send HTML mail!
    Regards

  • How to display html content with image in Adobe Flash and Flex mobile project?

    Hi,
      I have a html content with image in it. How to display it in Adobe Flash Builder and Flex mobile project? Which control needs to be used for this?

    Hello,
    The only current way is to use an iFrame, or if you only need some html tags you could use the Text Layout Framework.
    Here this is the iFrame approach:
    http://code.google.com/p/flex-iframe/
    If the swc do not work in Flex4 just use its ource code which works...
    ...it is basically based on this:
    http://www.deitte.com/archives/2008/07/dont_use_iframe.htm
    see also and vote, please:
    http://bugs.adobe.com/jira/browse/SDK-12291
    http://bugs.adobe.com/jira/browse/SDK-13740
    Regards
    Marc

  • How Mail work with image attachements and HTML image ?

    Hello,
    I'm writing an application that sends html emails with images to Mail.app. When Mail display the mail, everything is okay, images are correctly embedded in html code, using inline attachements.
    But there's still a problem : The images are also displayed at the bottom of the email, as file attachements. I know that Mail's template can hide these attachements, but I cannot reproduce it when sending my own emails.
    Is there anybody here that already get such problem and find the solution ? (apparently, Windows User get the same problem with Outlook, but they have an API under Windows...I'm using my own email API..)
    David

    David can you share how you managed to get the inline images to work. I've got the general idea of how to do it. But I do not seem to be able to change the Content-Type to multipart/mix. Can you point me in the right direction. Should the Content-Type definition and everything else be part of the body? Or should some headers (namely the multipart) be defined in the mailto URL format?
    In other words do you do: mailto:?subject=test&Content-Type=multipart/mix;%20boundary=myBoundary&body=--m yBoundary etc...
    Or id it: mailto:?subject=test&body=Content-Type=multipart/mix;%20boundary=myBoundary%20- -myBoundary etc..
    Neither seems to work for me so I am really stuck. But knowing what the right way is would help me figure things out a bit better.
    Thanks in advance

  • I have made a webpage in HTML with several links to JPGs / GIFs. The text matter opens perfectly but not the images. Please help me

    I have made a web page in HTML with several links to JPGs / GIFs. While text matter opens up perfectly, but not the images. Please help me.
    == This happened ==
    Every time Firefox opened
    == User Agent ==
    Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; CTS Version; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

    URL of that web page?

  • How to save HTML file with images present in the server to local machine

    Hi all
    In my application i have a option for the user to save HTML files with images present in the server. The HTML file is getting saved but the images are not being saved.
    The code i am using is below :-
    l
                        File fname = new File(filePath);
                        if(!fname.exists())                return;
                        FileInputStream istr = null;
                        OutputStream ostr = null;
                        response.setContentType("application/"+format);
                        response.setHeader("Content-Disposition", "attachment; filename=\"" + fname.getName() + "\";");
                        try { 
                             istr = new FileInputStream(fname);
                             ostr = response.getOutputStream();
                             int curByte=-1;
                             while( (curByte=istr.read()) !=-1)
                                  ostr.write(curByte);
                             ostr.flush();
    Can anyone suggest what i need to do
    regards

    The client should probably parse the html that comes down, and look for <img> links, and request those of the server as well.

  • BIS users in Pakistan::: HTML email view with images

    Mobilink, service provider, has updated their BIS to 2.5 in July. But they are unable to provide HTML email view with images on Blackberry sets running on ver. 4.5.
    Mobilink says that it is only available to BES users at the moment. BIS users will get it late on.
    Please explain, is it a Mobilink issue or RIM? as all around the world BIS users are getiing it.

    i dont beleive this. RIM wont leave  out Mobilink, infact they cant. The upgrade was done on BIS servers across the board not for some service providers. You probably wanna try another device or may be re-install oS On device?
    chk this thread: http://supportforums.blackberry.com/rim/board/message?board.id=BlackBerryInternetSolution&thread.id=...
    Click on KUDOS to appreciate our efforts and mark the thread RESOLVED if your issue is resolved.

  • How do i send an html file exported from muse as email blast with images and live links?

    My question it:
    How do i send an html file exported from muse as email blast with images and live links?
    I have designed a "website" in adobe muse and exported it as an html file. I am not sure how to send my .html file in an email!
    Best,
    Nicole

    Unfortunately, the answer is, you don't. The requirements for HTML displayed in an e-mail reader are very different than those for HTML displayed in a browser. The output of Muse won't work as an HTML e-mail. You could upload the Muse site as a website and provide a link to it in an e-mail, but the HTML generated by Muse is not suitable for direct display by an e-mail program.

  • Send html email with image embedded

    Hi Guys,
    I want send an email using class CL_BCS.
    Can someone please help me to tell me how can we send the email with image embedded in the body?
    The image is stored in the mime repository and was uploaded through se78.
    I have searched online but am not able to send it.
    It will be great if someone has working code for this.
    Regards,
    Dhruv Kashyap

    Hi go to T-code : SMW0   -- To upload the images , after that you can find that entries in wwwparams table .
    Refer this .
    **************** - Display images (like company logo) on the selection-screen
    In order to send it as email you have to add  attachment type as BMP from you BCS class.
    Just try you can .

  • Storing html along with images in database as Blob

    Hi,
    I have an html in which some images are embedded using image tags.Now I want to store this HTML as BLOB object such that both are stored in the same location, so that they can be retrieved using a jsp.
    Right now when I store the HTML, it gets properly displayed using jsp but the images are not displayed as images are stored locally.
    Can anyone suggest some approach for this?

    First of all, please excuse me about my por english.
    Some points to consider:
    1- I think you may have some issues understanding HTML. HTML only refers to images locations you cannot "put" immages "into" HTML.
    2- I supose you get the HTML as a String ad persists it on the DB. To get the images you must find the img tags in that string, get the src property and upload images individually.
    3- If you must store both HTML and images in the same BLOB field you have some problems, i think it could be fun to build something to do that, but not efficient. I sugest to use another field, another table really (1 to * relationship), to store images.
    4- When you display the HTML at your web server you must set the src attributes form de img tags pointig to some servlet that get the images form the DB, for example.
    I hope it helps you to understand the nature of your requeriment.

  • Can I generate html and images from the same script?

    I am trying to create a script that generates both html and gif images. Is there a way using the multipart mime content type to create a single stream that includes both html and images?

    No. Facing pages has been removed from Pages 5 along with 100 other features.
    If you want to view two parts of the same document you will need to rename a copy and place two windows side by side, which is hampered by Pages 5's bloated use of screen real estate.
    Peter

Maybe you are looking for

  • Printing using the built-in print drivers launches a PowerPC App.

    According to CNET: "Canon, Epson, and HP have all also announced that full universal binary drivers for their Apple peripherals will come with the iMac Core Duo as part of OS X 10.4." So one would think that if you use said drivers printing would not

  • I need Bapi's

    Hi to all,      I need BAPI /RFC Fun.module for : 1 ) Get the materials present in the selected material group. 2 ) for Scrap Mterial Its very urgent. Pionts ll b rewarded for this. Regards satya

  • I filled up the form to buy Adobe Premiere Elements 13 from Kolkata, India, but i cannot buy- Why?

    i filled up the form to buy Adobe Premiere Elements 13 from Kolkata, India, but i cannot buy- Why? i use Windows 8 and i am already using the Trial of the software. contact in [email protected]

  • Trouble shoot update rules error??

    Hello Experts, After i created an update rules, when i tried to activated the update rules, i encountered the error message as below: "IC=MA1SD_0 IS=MA1_IS_12VCITM error when checking the update rules Message no. RSAU461" can anyone advise how shall

  • What is the Party Shuffle on the Source List?

    In the manual it says it is a place to create a 'live' mix of songs that you want to include. However, that sounds just like what the Smart Playlist or any other playlist you want to create can do. Does anyone know the difference?