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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web page image

Status
Not open for further replies.

TSHDave

Technical User
Sep 18, 2003
66
0
0
GB
Hi, is it possible to embed a image into a web page (html) and not need to reference a external file?

a bit of background (should make my question a bit clearer)
I send a report from my intranet via email. The report is a simple html page with some stats in it. It also has our company logo at the top of the page. The logo is a reference to a image on our web server, but i want to send the page (with logo) without having to reference our web server or including the image in the email.

Thanks

Dave
 
See my FAQ, "Dynamic client-side image creation" (faq216-6010) for one method. There is another method, which you can see in use on the ACID2 test page:


by viewing the source of the test page itself.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
...i want to send the page (with logo) without having to reference our web server or including the image in the email

One way or another if you want the logo to appear on a "remote" computer then you are going to have to give them the logo. Whether "embedded" or not, the data will need to be given the computer.

It is possible, as Dan says, to dynamically generate an image using a server side language. But to do this for an image that is going to the be same every single time (like a logo) is somewhat pointless as you will be putting more load on your server than if you just linked to the image.

From how you describe what you wish to do I would say it is not possible to do it.
If you are sending an email then the image must either be attached to the mail and called using a cid: reference within the HTML or called from an external server via http:
If it's not available to the mail client then how is it going to display anything?

Can I ask why you don't want to send or link to the image? What is the perceived problem?

<honk>*:O)</honk>
Foamcow Heavy Industries - Web site design in Cheltenham and Gloucester
Ham and Jam - British & Commonwealth forces mod for Half Life 2
 
Foamcow,
The reason I didnt want to send the image in the email is because we send will be sending the report to our clients and if they pass it round internally then the image may end up seperated from the html file and the report just wouldnt look as good, we normaly send reports in an excel file and embed any logo's in the workbook. The reason I wanted to start using a HTML file is because we run a set of reports on our intranet for internal use and I have to create a VB.net app to automate the reports in excel, I have added a option to email any report ran on our intranet to the person who ran it so they can forward to our cliens without me having to create them a bespoke program, and the file simply looks better with a logo on it. It looks like I will just have to leave the logo on our web server and reference it there, the only down side is that if the report end's up with some one who has no internet connection then they wont see the logo, or I could try and get the webpage to creat a excel file based on a template that has the logo in it, if you can create a excel file based on a template from a web page that is.
Dan,
I'll check out thoses links you posted and see if they shed some new light on the issue.
 
You can certainly create an Excel file "on the fly" with ASP/PHP. It's just a matter of adjusting headers when you output the "page" (which would be an HTML table).

With ASP, for example, you would change the Content-Type to application/vnd.ms-excel and output an HTML table.

Whether it would embed an image or not I do not know.

There are a couple of other ways to do it with ASP too but I am unfamilar with those but I'm sure the ASP forum would be more help.

<honk>*:O)</honk>
Foamcow Heavy Industries - Web site design in Cheltenham and Gloucester
Ham and Jam - British & Commonwealth forces mod for Half Life 2
 
Thanks for the help on this one guys
 
For what it's worth I think the complexity of the possible solution far outweighs the gains over simply using a properly writted alt attribute in the HTML.

Code:
<img src="[URL unfurl="true"]http://mysite.com/mylogo.gif"[/URL] alt="Company Name - Company Strapline">

If the file isn't available it will still show the company name. No big loss. The report certainly won't lose it's context. And to be honest you should use an alt attribute anyway.


<honk>*:O)</honk>
Foamcow Heavy Industries - Web site design in Cheltenham and Gloucester
Ham and Jam - British & Commonwealth forces mod for Half Life 2
 
I tried the alt attribute (<IMG SRC= ALT=Positive Contact></IMG>) but when I removed my proxy settings (to stop my pc contacting our web server) the alt text didnt display, just the missing image box with the small red x in it.
 
I have tried that but then i get the following error

Microsoft VBScript compilation error '800a03ee'

Expected ')'

/Reports/Genrep/_Genrep.asp, line 334

stremaildata = stremaildata & ("<IMG SRC= ALT="Company Name"></IMG><br><br>")
 
it worked with the single quotes, is there a way to stop the red x from displaying?
 
yep that would do it, but if the image didnt load I take it i have to live with the small red x.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top