Click here to get back home

Absolute file names for links

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Absolute file names for links Dave 02-28-2008
Posted by Dave on February 28, 2008, 5:28 pm
Please log in for more thread options
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:
F:\Documents\ArtWork

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?

Thanks,
Dave


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

Posted by David E. Ross on February 28, 2008, 11:28 pm
Please log in for more thread options
On 2/28/2008 2:28 PM, Dave wrote:
> 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:
> F:\Documents\ArtWork
>
> 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?
>
> Thanks,
> Dave
>
>

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
<http://www.rossde.com/>

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

Posted by Jonathan N. Little on February 29, 2008, 9:32 am
Please log in for more thread options
Dave wrote:
> 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:
> F:\Documents\ArtWork
>
> 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?
>
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,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

Posted by Jim Moe on February 29, 2008, 4:14 pm
Please log in for more thread options
On 02/28/08 03:28 pm, Dave wrote:
>
> 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?
>
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)

Posted by Steve Swift on March 1, 2008, 3:34 am
Please log in for more thread options
Jim Moe wrote:
> 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.

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
http://www.swiftys.org.uk/swifty.html
http://www.ringers.org.uk

Similar ThreadsPosted
Re file names and IE October 15, 2005, 1:28 am
Semantics: Program & File Names? June 24, 2007, 7:35 pm
How can I dynamically add file links to a html document? May 31, 2005, 7:40 am
Resource to search HTML code for links to a specific file November 18, 2005, 1:13 pm
Link to a frames based page links to wrong html file. June 14, 2006, 6:53 pm
Style absolute positioning October 25, 2004, 12:14 pm
Is it good to use absolute URLs? November 4, 2004, 11:42 am
absolute div in table cell April 27, 2005, 3:02 pm
horizontally centering an absolute positioned div December 20, 2004, 1:50 pm
newbie: remove absolute path in js array April 5, 2006, 4:17 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap