Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Local file reference

Reply
Thread Tools

Local file reference

 
 
Edward
Guest
Posts: n/a
 
      09-10-2005
I'm creating and testing basic web pages, and learning HTML.
How do you refer an image source or a link to a local file.jpg for example?
I've tried <img src="C:\image.jpg" align="center"/> without success. The
only way my web page will see files when testing is to load them on my
actual web server.
<img src="http://www.domain.com/image.jpg" align="center" />

Thanks



 
Reply With Quote
 
 
 
 
Spartanicus
Guest
Posts: n/a
 
      09-10-2005
"Edward" <(E-Mail Removed)> wrote:

>I'm creating and testing basic web pages, and learning HTML.
>How do you refer an image source or a link to a local file.jpg for example?


file://localhost/C:/image.jpg

But since you claim to be building a *web* page, you will be the only
one to see it.

--
Spartanicus
 
Reply With Quote
 
 
 
 
Edward
Guest
Posts: n/a
 
      09-10-2005
Very true.
Until its polished, and working, and has a web server on which to reside,
and not on my local pc.

Thanks

"Spartanicus" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) anicus.utvinternet.ie...
> "Edward" <(E-Mail Removed)> wrote:
>
> >I'm creating and testing basic web pages, and learning HTML.
> >How do you refer an image source or a link to a local file.jpg for

example?
>
> file://localhost/C:/image.jpg
>
> But since you claim to be building a *web* page, you will be the only
> one to see it.
>
> --
> Spartanicus



 
Reply With Quote
 
David Dorward
Guest
Posts: n/a
 
      09-10-2005
Edward wrote:

> I'm creating and testing basic web pages, and learning HTML.
> How do you refer an image source or a link to a local file.jpg for
> example?


Absolute URLs? Depends on the browser and OS. You're almost certainly best
off using relative URLs ...

http://www.iusmentis.com/technology/www/relativeurls/

.... , or installing a webserver on your workstation ...

http://httpd.apache.org/

> I've tried <img src="C:\image.jpg" align="center"/> without success.


Aside from the issues of how absolute URLs to local file systems are
handled, the "align" attribute is deprecated and should not be used, the
alt attribute (which you don't have) is required, and Appendix C of the
XHTML 1.0 spec requires a space before the "/" (although XHTML is not
usually a good idea and you would be better off sticking to HTML 4.01).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
 
Reply With Quote
 
Ken
Guest
Posts: n/a
 
      09-10-2005
Hi Edward -

On Sat, 10 Sep 2005 17:01:24 -0500, "Edward" <(E-Mail Removed)> wrote:

>I'm creating and testing basic web pages, and learning HTML.
>How do you refer an image source or a link to a local file.jpg for example?
>I've tried <img src="C:\image.jpg" align="center"/> without success. The
>only way my web page will see files when testing is to load them on my
>actual web server.
><img src="http://www.domain.com/image.jpg" align="center" />


src="image.jpg"

If the page is in c:\ the browser will look for c:\image.jpg

If the page is in http://www.example.com/ the browser will look for
http://www.example.com/image.jpg

--
Ken
http://www.ke9nr.net/
 
Reply With Quote
 
Edward
Guest
Posts: n/a
 
      09-11-2005
Thanks Ken

"Ken" <ng3122@ke9nr.#nospam#.net.invalid> wrote in message
news:(E-Mail Removed)...
> Hi Edward -
>
> On Sat, 10 Sep 2005 17:01:24 -0500, "Edward" <(E-Mail Removed)> wrote:
>
> >I'm creating and testing basic web pages, and learning HTML.
> >How do you refer an image source or a link to a local file.jpg for

example?
> >I've tried <img src="C:\image.jpg" align="center"/> without success. The
> >only way my web page will see files when testing is to load them on my
> >actual web server.
> ><img src="http://www.domain.com/image.jpg" align="center" />

>
> src="image.jpg"
>
> If the page is in c:\ the browser will look for c:\image.jpg
>
> If the page is in http://www.example.com/ the browser will look for
> http://www.example.com/image.jpg
>
> --
> Ken
> http://www.ke9nr.net/



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access local port or Running local exe file =?Utf-8?B?WVNVVA==?= ASP .Net 0 01-14-2006 12:41 AM
Playing a local mpeg file from a local HTML file... Lyndon HTML 1 07-25-2005 02:21 AM
Browser link to local file works when local, not work when servedfrom http lurker HTML 1 04-05-2005 05:10 AM
How to tell if a reference is project or file reference from within the IDE? Darren ASP .Net 0 10-11-2004 12:51 AM
Error problem: asp.net app trying to reference local file? =?Utf-8?B?c3RldmVfbw==?= ASP .Net 1 02-16-2004 01:48 PM



Advertisments