Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Include image INSIDE single html file

Status
Not open for further replies.

GriffMG

Programmer
Mar 4, 2002
6,333
FR
Hello, new to this forum - normally work in Clipper/VFP.

I have a app which generates html files for e-mailing as orders, quotes and so forth. The recipients can get and read the files, but are generally 'off-line' from the internet for 'security reasons' (i.e. their comapnies only allow a few people to surf).

My client is very keen to include his logo on the documents, but if I use an IMG tag with the 'src= then they generally can't get to it.

There surely is a way to include the contents of the .gif inside the html - does anyone here know how, or could anyone point me in the right direction?

TIA
Regards

Griff
Keep [Smile]ing
 
Griff,

I do this for our company e-mails, hope it applies to your situation....

I use windows Outlook Express for e-mailing.

My email pages are HTML documents I store in the STATIONERY folder, along with the image file , say logo.gif . My link in the html document is simply <img src=&quot;logo.gif&quot;>

Seems to retain image info in the recipient's inbox, so can be read offline with all image detail.

hope this helps, good luck

Graham
 
Thanks, but some clients aren't using outlook (me for example) again for anti-virus reasons!

I really want the gif data inside the html somehow.

Thanks all the same for your thoughts Regards

Griff
Keep [Smile]ing
 
Griff,

OK, what e-mail system are you using or do you plan to use?

Have you tried locating the graphic in the same folder as the HTML file and using a relative link like I described, rather than an absolute link as you described ?

Regards,

Graham
 
The client may be running:

outlook,
outlook express,
pegasus
calypso
groupwise
notes
one per desk
openmail
mac
anything really
Regards

Griff
Keep [Smile]ing
 
Graham,

Sorry - that was a bit rude, glib, flippant and superficial.

I want the recipient to receive the actual HTM as an attachment to an e-mail because my client has no control over the e-mail programs being used by his suppliers and customers. Already a number of his customers have switched away from outlook/exchange and other e-mail programs that display HTM messages automatically as they feel there are
security risks.

What I really want is to do something like the now defunct first-e bank used to do where they included the data for a .pdf file inside an HTM, except I want it to be the .gif file for a logo (and later for signatures, and other gimics as I think of them).

I am pretty sure this can be done, but I have no idea where to start!

Any help would be gratefully received.

TIA Regards

Griff
Keep [Smile]ing
 
Griff,

OK, I get the message! No problems, I understand what you need.

Well, to be honest, I'm out of further suggestions for the moment. You can't simply embed a picture within html unless it's a VERY crude one, which you could code at, a push. Yuk!

I'll bear it in mind, and if any inspiration comes to me I'll let you know. Anyone else got any suggestions ?

Cheers and good luck,
Graham
 
This page contains a good summary of MHTML, which is an IETF standard that allows you to embed multiple files (such as an HTML file along with its associated graphics, as in your request) in a single email message. I haven't done much development in this area, but this should get you started.


One implementation of this standard is when you save a web page in Internet Explorer as a &quot;Web Archive (.mht)&quot;. You can look at the resulting .mht file in a text editor and see basically how MHTML works.

Hope this gets you started!
 
Hi Griff,

Unfortunately, HTML provides no method of &quot;imbedding&quot; image data inside the source code. The only alternative that I can think that could do that is active scripting-- either JavaScript or VBScript.

The general idea would be to encode the raw image data as a series of escaped values such as %023, %255, etc. Those values along with the necessary scripting to decode them would then be imbedded inside the HTML document.

When the document is opened the local scripting engine would run and reverse the process-- converting the values back into an array representing the original image. The image array could be written out as a local file and then called for display as part of the page.
 
Thank you all for trying, I think Haggas is closest - although I have an idea that the client side scripts are prevented from writing to a local file - a security feature of client side scripting to reduce the chances of viruses.

I have an idea that if I generate the image in IIS (i.e. server side) and get it into a variable - as you would for
rollovers etc I might be able to turn it into some kind of code.

That then could be sent to the client side as the content of a hidden field or somesuch - time to play!

Thank you all again

Regards

Griff
Keep [Smile]ing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top