Posted by Mike.Duffy on February 27, 2007, 8:24 pm
Please log in for more thread options
What is the default directory in the client file system that is used for
file urls?
From performing a few experiments, it is clear that an unqualified
reference from another file url is always directed to the source directory.
I.e., from within url "file://c:/abc/def.htm", if you make a reference like
<href="ghi.htm">, or <img src="jkl.gif">,the browser will look for "file://c:/abc/ghi.htm" or "file://c:/abc/jkl.gif".
But from within url "http://mno.htm", (i.e. a file you put on a web server)
if you use <href="file://ghi.htm">, or <img src="file://jkl.gif">, exactly
where does the browser look for the file? I realize that it would likely be
OS-dependant, but am chiefly interested in the Windows environment. Does it
use one of those user or system environment variables? Or will it always
fail? I have not been able to guess where to put the files in order to
"find" them like this. Does anyone have any suggestions before I take the
systematic approach of placing a watermarked file into every sub-directory
in my filesystem and seeing what comes up? I think I can actually do this
with a small amount of effort using one of those freeware html index
builder programs, but it would probably take a while to run. (And clean up
afterwards!!)
Posted by Jukka K. Korpela on February 28, 2007, 2:53 am
Please log in for more thread options
Scripsit Mike.Duffy:
> What is the default directory in the client file system that is used
> for file urls?
Whatever the browser programmers decided. The detailed syntax and especially
the meaning of file urls is system-dependent, making them almost useless in
WWW authoring. You don't actually see them much on web pages except as
products of wrong use of authoring software that uses them internally
(replacing them by http urls when used properly).
> From performing a few experiments, it is clear that an unqualified
> reference from another file url is always directed to the source
> directory.
That might happen in the browsers you have tested. You have a few hundreds
of millions of other situations to test.
> I have not
> been able to guess where to put the files in order to "find" them
> like this.
Just stop the guesswork and upload the files onto a web server (or other
http server), or - if you're doing this for your own use or very restricted
user range only - use relative references (with no protocol part anywhere)
only.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Posted by Mike.Duffy on March 7, 2007, 4:24 pm
Please log in for more thread options
> Scripsit Mike.Duffy:
>
>> What is the default directory in the client file system that is used
>> for file urls?
> You don't actually see them much on web pages except as
> products of wrong use of authoring software
>...
> Just stop the guesswork and upload the files onto a web server
My "application" is a js program that creates a customized short story
intended for a juvenile audience. The user is presenetd with a form where
the reader can enter names for the story characters. One feature of the
program that generates the story is that it puts little pictures next to
the text of the character who is speaking. (I.e. like most chat programs.)
I wanted to add a field to allow the end user (or his/her parent) to
specify the file name of a local gif/jpg/bmp file in order to customize the
pictures as well. (So the kid gets his own picture beside his name.)
I actually succeeded in doing this. Take a look at the reply to another
post in the same thread I made a few minutes ago.
You are likely correct about the app not working on systems I have not
tested, but if it works for Windows / IE6, that covers most people anyways.
If it doesn't work, the user can just leave those fields blank and use the
default pictures.
Posted by Jukka K. Korpela on March 8, 2007, 1:16 am
Please log in for more thread options
Scripsit Mike.Duffy:
> My "application" is a js program that creates a customized short story
> intended for a juvenile audience.
So your problem has nothing to do with authoring for the WWW, even though
you posted to c.i.w.a.h., too.
> One
> feature of the program that generates the story is that it puts
> little pictures next to the text of the character who is speaking.
It sounds like you have no good reason to use HTML in the first place.
Surely there are better ways to create a user interface for an interactive
program.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
Posted by Mike.Duffy on March 9, 2007, 10:41 pm
Please log in for more thread options
> Scripsit Mike.Duffy:
>
>> My "application" is a js program that creates a customized short
>> story intended for a juvenile audience.
>
> So your problem has nothing to do with authoring for the WWW,
It is intended as a WWW-based application. I thought that was implicit by
virtue of the use of javascript and the "http://" url references.
> Surely there are better ways to create a user interface for an
> interactive program.
After the items are entered in the form and the button is pressed, it is
not really interactive anymore. The advantage of using the Web based
approach is that the end-user does not need to install a program to run it.
>
> It sounds like you have no good reason to use HTML in the first place.
Bringing smiles to the faces of children around the world is a good enough
reason for me. What would you consider to be a good reason?