-3

Well, I am working on a coldfusion page, however, most of the stuff I am doing in there is HTML related. Hence wondering, is there a way, I can Insert a JPEG image in a coldfusion page?

I saw this document but it's for ZIP files :http://www.bennadel.com/blog/1464-Embedding-ZIP-Files-Inside-JPG-Files-Using-ColdFusion.htm

Please let me know how can I achieve this?

How I am getting an image:

Basically I have been provided a MS Word doc and inside that , there is a small credit card size image. So, I have copied and pasted that image onto Paint and then cropped that image to maintain the size and then I saved it in JPEG format. I hope the procedure I followed is fine.

More Clarifications:

This HTML/Coldfusion page will be used as a template in a email editor and will be send.I am just wondering if using an img tag as suggested in one of the answer below would still work in that case? I hope this doesn't sounds like 100% different question now?

Matt Busche
  • 14,216
  • 5
  • 36
  • 61
Jack
  • 989
  • 3
  • 13
  • 24
  • 1
    Sounds like you shouldn't be using ColdFusion to extract the image from the Word document. It sounds like a once off process. If it's a .xlsx document, it's is "unzippable". You can extract the original image using any unzip tool. – Mike Causer Dec 20 '13 at 09:59
  • I am not using Coldfusion to extract the image from Word Document. I have manually copied the image from the Word document and pasted it into the Paint and then cropped it and saved it in JPEG format. I am wondering if this would work with the usage of img tag? – Jack Dec 20 '13 at 10:01
  • Emails are static text/html. Your ColdFusion page may generate the html for the email, which may include `` tags, but it sounds like you are trying to ask how to serve images from your ColdFusion app to an email client. If that's the case, as long as your .jpg is web accessible, put it's absolute path `http:// ... .jpg` in the email content. – Mike Causer Dec 20 '13 at 10:04
  • Another option is to embed the image. "Embedding" converts the image into Base64 (plain text) and includes it with the email contents. If you "View message headers" in Outlook or "Show original" in Gmail, you'll be able to see message boundaries. – Mike Causer Dec 20 '13 at 10:06
  • That makes sense @MikeCauser. I'll make sure my image is accessible with it's absolute path somehow. Thanks for your input. BTW Do you know if there's is any way of embedding the image using coldfusion? – Jack Dec 20 '13 at 10:06
  • I would prefer embedding the Image option. – Jack Dec 20 '13 at 10:08
  • Embedding has it's pros and cons. On one hand, they receive the entire message with bundled images and do not require loading any remote resources at runtime. You do not need to have a server available to serve the images to recipients. And on the other hand, you have to send more bits down the pipe, which may cost you more in bandwidth. – Mike Causer Dec 20 '13 at 10:08
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/43576/discussion-between-jack-and-mike-causer) – Jack Dec 20 '13 at 10:08
  • 1
    How to embed images in ``: http://www.bennadel.com/blog/61-CFMail-CFMAILPARAM-Used-to-Embed-Images-in-Email.htm – Mike Causer Dec 20 '13 at 10:10
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/43613/discussion-between-jack-and-mike-causer) – Jack Dec 20 '13 at 17:48

1 Answers1

5

I may be misunderstanding your question, but you just want to use the img tag. It's no different than any HTML page

<img src="yourphoto.jpg" alt="myImage">

If you want the image embedded in an email then you can use cfmailparam

 <cfmailparam file="http://yoursite.com/image.jpg" disposition="inline">
Matt Busche
  • 14,216
  • 5
  • 36
  • 61