Absolute file names for links

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
As long as I keep graphic files in a folder below the HTML the
graphics are found, but the actual location of the graphics are on a
different disk.  Tried all manner of things, but can't get the
graphics to load, so would appreciate some help.

Test setup is:
D:\Programs\Editor\WebProject\HTML        // The code
        ..\WebProject\HTML\Graphics    // Graphics

The actual location of the graphics is:

What I need to do is get the absolute link to the file correct, so I
need some help here.  Funny thing is that if the absolute link is a
web address it works just fine, but not a Windows file.

I agree that placing the graphics either under the HTLM folder or on
the same level is a better idea, but that won't happen until all of
the art is approved, which won't happen until the demo web page is
done.  See the problem?


e-mail: d boland 9 (all 1 word) at fastmail period fm

Re: Absolute file names for links

On 2/28/2008 2:28 PM, Dave wrote:
Quoted text here. Click to load it

In general, browsers cannot interpret Windows shortcuts.  If the
graphics are in [F:\Documents\ArtWork], then that's the path you must
use, not [D:\Programs\Editor\WebProject\HTML\Graphics].

David Ross

Have you been using Netscape and now feel abandoned by AOL?
Then use SeaMonkey.  Go to <http://www.seamonkey-project.org/ .

Re: Absolute file names for links

Dave wrote:
Quoted text here. Click to load it
With a *nix system you could use a symbolic link:

/var/www/sites/example.com/imagefolder -> /somewhere/entirely/different

and then later remove "imagefolder" link and replace as folder
"imagefolder" and move all images from "/somewhere/entirely/different"
into it. AFAIK you cannot do this with Windows. So you have 2 options.

1) Use absolute links in the html that will later have to be changed.
BTW don't use Windows-centric path nomenclature but rather:

"file:///F:/Documents/ArtWork/someimage.jpg" that later you will change
to: "Graphics/someimage.jpg"

2) Make copies of images in "F:\Documents\ArtWork" to
"D:\Programs\Editor\WebProject\HTML\Graphics" and just keep folders
synchronized and then just use the relative paths in your html
"Graphics/someimage.jpg" and you won't have to change anything to publish.

3) A third possibility that just occurred to me is to dig up an old
system and slap Linux & Apache on it which would give you the
flexibility that I first mentioned, (symbolic links can point to NFS
mounted folders)... and your development server would more closely
emulate the majority of web servers that a live on the web.

Take care,

Re: Absolute file names for links

On 02/28/08 03:28 pm, Dave wrote:
Quoted text here. Click to load it
  As Jonathan Little observed, why don't you have a local web server to
test your code? Using local filesystem paths in an HTML document only
means you have additional maintenance problems and opportunities for error.

jmm (hyphen) list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)

Re: Absolute file names for links

Jim Moe wrote:
Quoted text here. Click to load it

I couldn't agree more.  It takes only a few minutes to install the
Apache webserver.

There are some things that you cannot test using local files. One
example is the JavaScript used to manipulate the date of the document
itself (for a primitive example see: http://www.swiftys.org.uk/ ). When
fetched as a local file, the document.Lastmodified returns nothing useful.

Steve Swift

Re: Absolute file names for links

Steve Swift wrote:
Quoted text here. Click to load it

Doing it with PHP works on a local Apache (I'm using WAMP) installation.

$last_modified = filemtime("index.php");
print(" Updated as of:  ");
print(date("F j, Y - h:i A", $last_modified));

I use this on some pages of my site.

Ed Mullen
The average woman would rather have beauty than brains because the
average man can see better than he can think.

Re: Absolute file names for links

In comp.infosystems.www.authoring.html message <47ca623b$1@news.greennet

Quoted text here. Click to load it

I don't see that problem.

If you need to support browsers without getFullYear (which IIRC was
available in MS IE 4 in 1998),   year = 2000 + D.getYear()%100   should
serve our time, unless you are surprisingly young.

If you were to use array literals, Initialize and +1 could be omitted.

Where the time is given to the minute, would it not be well to indicate
what sort of time it is?  IIRC, it's GMT; but older browsers may not put
GMT in .lastModified, in which case it should be appended.

I don't think "Odd ball" should be two words.

It's a good idea to read the newsgroup c.l.j and its FAQ.  See below.

 (c) John Stockton, nr London UK. ?@merlyn.demon.co.uk   IE6 IE7 FF2 Op9 Sf3
 news:comp.lang.javascript FAQ <URL:http://www.jibbering.com/faq/index.html .
 <URL:http://www.merlyn.demon.co.uk/js-index.htm jscr maths, dates, sources.
 <URL:http://www.merlyn.demon.co.uk/ TP/BP/Delphi/jscr/&c, FAQ items, links.

Site Timeline