aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Including images directly in HTML files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Including images directly in HTML files" Watch "Including images directly in HTML files" New topic
Author

Including images directly in HTML files

Ruediger Waurig
Greenhorn

Joined: Jul 24, 2001
Posts: 19
Hi there,
I've got the following question:
Usually placing an image in a HTML file is done by
<img SRC="myPicture.jpg">
or
<OBJECT type="image/jpg" data="myPicture.jpg">
</OBJECT>
But this means that there is an external file that contains the image, in this case myPicture.jpg
I don't want to have an additional external file that is referenced from within the HTML file. How can I manage to have the image be included directly in the HTML file itself?
I.e. when sending an e-mail in html format then the pictures are included in the same html file.
Ruediger
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60998
    
  65

No can do. HTML just doesn't do that.
E-mail messages that seem to "embed" images in HTML actually do no such thing. Rather, they are multi-part messages where the HTML is included in one part, and any "embedded" images are stored in other parts. The mail client peices it all together for display.
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

XML includes the ability to embed binary data, so in theory it may be possible in XHTML, but I really doubt that anyone has bothered to implement anything like this in the clients.
Like Bear says, HTML just doesn't do that.
Dave
 
wood burning stoves
 
subject: Including images directly in HTML files