Local file reference

Discussion in 'HTML' started by Edward, Sep 10, 2005.

  1. Edward

    Edward Guest

    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
     
    Edward, Sep 10, 2005
    #1
    1. Advertising

  2. Edward

    Spartanicus Guest

    "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?


    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
     
    Spartanicus, Sep 10, 2005
    #2
    1. Advertising

  3. Edward

    Edward Guest

    Very true.
    Until its polished, and working, and has a web server on which to reside,
    and not on my local pc.

    Thanks

    "Spartanicus" <> wrote in message
    news:...
    > "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?
    >
    > 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
     
    Edward, Sep 10, 2005
    #3
  4. 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
     
    David Dorward, Sep 10, 2005
    #4
  5. Edward

    Ken Guest

    Hi Edward -

    On Sat, 10 Sep 2005 17:01:24 -0500, "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?
    >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/
     
    Ken, Sep 11, 2005
    #5
  6. Edward

    Edward Guest

    Thanks Ken

    "Ken" <ng3122@ke9nr.#nospam#.net.invalid> wrote in message
    news:...
    > Hi Edward -
    >
    > On Sat, 10 Sep 2005 17:01:24 -0500, "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?
    > >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/
     
    Edward, Sep 11, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. karim
    Replies:
    1
    Views:
    776
    George Ter-Saakov
    Jun 26, 2003
  2. =?Utf-8?B?c3RldmVfbw==?=

    Error problem: asp.net app trying to reference local file?

    =?Utf-8?B?c3RldmVfbw==?=, Feb 16, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    602
    John Oakes
    Feb 16, 2004
  3. =?Utf-8?B?WVNVVA==?=

    Access local port or Running local exe file

    =?Utf-8?B?WVNVVA==?=, Jan 14, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    519
    =?Utf-8?B?WVNVVA==?=
    Jan 14, 2006
  4. lurker
    Replies:
    1
    Views:
    703
    Disco Octopus
    Apr 5, 2005
  5. Lyndon
    Replies:
    1
    Views:
    524
    Leonard Blaisdell
    Jul 25, 2005
Loading...

Share This Page