Re: Problem with opening files from http://localhost - Win XP

From: David Wang [Msft] (someone_at_online.microsoft.com)
Date: 09/10/04


Date: Fri, 10 Sep 2004 00:44:08 -0700

First, this is not a roblem with Windows XP nor IIS. This is purely a
configuration problem that you should solve so that the client behaves the
way you want.

Now, creating a web page with links that look like file:/// -- i.e. local
file links -- is pretty useless because only you can browse the link
successfully. Such links presume that the remote user visiting your site
already has your site's contents downloaded locally to their machine --
which is unlikely to be the case. To fix this, please make sure that the
href points to something that is always accessible to the remote user --
like a valid URL.

Next, when you click a link, you are telling the browser "please download
the contents of this link to my local machine". Note: no one is "executing"
this link, or "opening the link in you editor", etc -- the browser is merely
making an HTTP request to the server for that resource, and the web server
is simply returning the contents of the resource as-is.

Modern browsers, after they obtain the contents of the link, will parse the
Content-Type header that was sent with the link's contents and then decide
what to do with it. If the content-type is "text/html", the browser will
merely display the downloaded file as HTML -- regardless of the file's
extension. Similarly, .WAV files have a content-type of "audio/wav", which
causes the browser to look up its local definition of
MIMEMap-to-Handler-Application mapping and decide what to do with it.

Finally, browsers have security features that do not automatically "execute"
content downloaded from servers -- that is, even though .EXE files have a
content-type of ".exe,application/octet-stream", once a browser downloads it
all, it isn't going to automatically execute it on the client. Instead, the
browser will ask you "should I save it, open it, or do nothing?"

Getting back to your question -- from a shell's perspective, the same
webpage (index.html), opened from your desktop (a folder) and
C:\inetpub\wwwroot (another folder) is no different. Since you claim that
the same page has different behavior, I think you are not "Loading" the file
identically. The UI may look the same, but one is probably handled by the
shell without going through a web server, while the other one is going
through the web server somehow. The latter case will require a valid
Content-Type (you have to have the correct MIMEType registered) and likely
won't behave identically to the local shell case.

ALso, what SP of W2K and WXP are we talking about?

-- 
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"jib" <jib@discussions.microsoft.com> wrote in message
news:772C65DD-D0ED-4963-8659-B951BE24F04B@microsoft.com...
Hi
I have a webpage with links along the lines of
<A href="file:///c:/test.wav">test.wav</A>
if i save the webpage (index.html) on my desktop and load it from there and
click the link the file opens in my chosen editor - soundforge
if i save the webpage in c:/inetpub/wwwroot and load it from there and click
the link nothing happens
i have this running under Win2k and am looking to make it work on Windows
XP.
can anyone help??
many thanks
jib


Relevant Pages

  • Re: OT: windoze woes and full rant mode is on
    ... If I try and download it to the client, ... EVERYTHING on the web server, then simply serve up a dynamically ... constructed page that suits the particular browser being used. ... I was really hoping Java would have taken off more than it did. ...
    (comp.lang.cobol)
  • Re: Hyperlink problem
    ... >> Okay, we're talking about a web site and a browser here, right? ... >> hyperlinks in a page that point to "frequently used programs or files" - ... >> download resources from a web server. ... it will prompt the user to either download and save ...
    (microsoft.public.frontpage.programming)
  • Re: Problem with opening files from http://localhost - Win XP
    ... after your reassurance that the problem wasnt with XP or IIS i started to ... > Next, when you click a link, you are telling the browser "please download ... > making an HTTP request to the server for that resource, and the web server ... > if i save the webpage on my desktop and load it from there and ...
    (microsoft.public.inetserver.iis)
  • Re: Hyperlink problem
    ... > Okay, we're talking about a web site and a browser here, right? ... what makes you think you can crete a hyperlink to a program and the ... download resources from a web server. ...
    (microsoft.public.frontpage.programming)
  • unable to download file correctly using IE6
    ... I recently removed a file that hijacked my browser (the ... webpage it was loading was www.hvkd.us). ... When I click on a link to download a file ...
    (microsoft.public.windows.inetexplorer.ie6.browser)

Loading