Closed Bug 83310 Opened 19 years ago Closed 19 years ago

URLs with UNC paths with forward slashes don't load


(Core :: Networking: File, defect)

Windows 2000
Not set





(Reporter: brennan, Assigned: dougt)




From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9) Gecko/20010505
BuildID:    2001050515

URLs of this form  file://host/share/file.html cause Mozilla to
do nothing.   The icon animates and the status bar animates,
but the page never loads.  The URL file:\\host\share\file.html
gets rewritten as file://///host/share/file.html and loads
correctly.  (The 5 slashes seem odd, but that's probably a
nother bug).  Although perhaps not technically a correct URL,
IE5 and Netscape 4 both support this syntax and there are
many web pages (on intranets) that use this.

Reproducible: Always
Steps to Reproduce:
1. Create a file foo.html on your NT box in C:\TEMP
2. Create a share called TEMP that shares C:\TEMP
3. Try to open file://<your machine>//temp/foo.html

Actual Results:  Browser never displayed foo.html
Icon's animated, but nothing else happened

Expected Results:  The foo.html page to display in the browser

I noticed this when trying to click a link on a page
that had a URL of this format, but it's easier to reproduce
by opening the URL directly.
Assignee: asa → dougt
Component: Browser-General → Networking: File
QA Contact: doronr → tever
Whiteboard: DUPEME
dupe of 70871 perhaps
I think this is different than <a 
which is about Linux.  What does //server/dir/file.txt mean on Linux?
At a shell prompt if I do

ls //server/dir/file.txt

I get 'No such file or directory'.   Is this supposed to be a Linux short hand 
for the NFS share dir on machine server?  I suspect Mozilla is doing
the correct thing by ignoring the server name in file://server on Linux
because I can't think of any common interpretation of it.

This PR is about Windows UNC paths, which are typically written
with back slashes.  You can do

dir \\server\dir\file.txt

in a Command Prompt on windows and that works fine
if machine server has a share dir for a directory that has
file.txt in it.

For historical reasons that I don't understand, IE and NS4
Accept file://server/dir/file.txt as well as file:\\server\dir\file.txt,
so web page authors (or maybe their authoring tools) insert
these kinds of links - I see them often on our intranet.

*** This bug has been marked as a duplicate of 66194 ***
Closed: 19 years ago
Keywords: verifyme
Resolution: --- → DUPLICATE
Whiteboard: DUPEME
vrfy dup
Keywords: verifyme
file://///host/share/file.html is the correct format.

For now, having text between the 2nd and 3rd slash is not working. In theory, it 
should support HOSTNAME (of your system) or "localhost" or VOID. That is the 
topic of bug 70871.

re: what it means in Linux

file URLs are inherently local, have no host-host portability, much less OS-OS.

file://server/dir/file.txt - not legal, although it might have worked at some 
time, I'm still investigating.

file:\\server\dir\file.txt - not legal b/c the slashes are wrong, auto 
conversion was pondered for all URLs in bug 32895, and in bug 93197, some auto 
conversion for JUST file in JUST Windows is pondered...

If you know what tools are creating these file URLs, I would appreciate a bug in 
"Networking: File" against each authoring tool.
You need to log in before you can comment on or make changes to this bug.