It's not a secret anymore!
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
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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: 56549
    
  14

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


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Including images directly in HTML files
 
Similar Threads
jspinlcude
include tag
problems in showing images in jsp with contentType= application /msword
How to use java.awt.Image with HTML?
How to use java.awt.Image with HTML?