Closed Bug 289875 Opened 20 years ago Closed 20 years ago

doesn't find html files when offline and everything is relative paths

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: laextr, Assigned: bugzilla)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.6) Gecko/20050317 Firefox/1.0.2 After writing a program that edits html files to use relative paths to open images, Mozilla doesn't find it. A first I thoaght it was a bug in my app untill I ran Mozilla in Linux, Internet Explorer in Windows, etc. then it worked 100%. This is what Mozilla Firefox has problems with: Example: Lets say we're in "c:\my webs". Now I have file1.html that has a link to file2.html but file2.html is in "c:\my webs\more" and file1.html uses the link "more\file2.html". The thing is sometimes file2.html is opened, but lets say we have another subdirectory "c:\my webs\more\images" and images has image1.gif. Now since file2.html also uses relative paths : "images\image1.gif", the images is found at all and gives a Protocol error or something. Reproducible: Always Steps to Reproduce: 1. Create any directory anywhere (wherever you want to) 2. Create a sub directory "sub" in (1.)'s directory, sothat you will have : "..\your_dir_name\sub" 3. Create "images" in "sub" : "..\your_dir_name\sub\images" 4. Put an image file in "images" 5. Create a html file in "sub" but link the image in "images" relatively : "images\image.gif" for example 6. Create an html file in "your_dir_name" that links to the html file in "sub" but also relatively. Actual Results: The html file in "sub" doesn't show the images Expected Results: It should show the images It kept giving me something like "e" is not a protocol or something. (The e was my drive "e:\")
Do you have a testcase? Are you using the file:// or the http:// protocol?
Well the link field in <a href=""> is just the link to that file. So I reckon that it should use file://
laextr, I assume that you mother tongue is not English, so I hope that you don't take offence if imply that I haven't understood quite a bit of your problem. Does your main page have <a> tags (anchors) like <a href="file1.html">file1</a> <a href="more/file1.html">file2</a> <a href="more/images/image1.gif">image1.gif</a> ? Mozilla has a sister program called Nvu which allows the creation of pages visually, and you may want to see what you pages look like in that editor. I assume that you mean "... the images are not found at all ..."; and I fear that I can't be sure what you mean by "gives a Protocol error or something". You will need to provide the exact error message. If you have a URL that starts 'e:/' any compliant web browser will complain the "e is not a registered protocol" If you are a beginner at writing web pages, then few of us here are good people to give tuition, as we have long since forgotten what it was like not to know how URLs work. You would be best advised to find a colleague who can watch what you do and offer help, and to be sure to choose the best tools for the job.
No its cool Ben! I guess I didn't write clearly as I have hoped for. Like I said (with no offence taken ;) ), it worked 100% in Internet Explorer, Mozilla (original) for Linux, Konqueror, and so on. I did make the anchors for the links, but it looks like it stopped talking about the protocol error thing so unfortionantly I can't give you the protocol error message, but it did use the file:/// protocol to access hard-drive files. Maybe I'll run some of my saved webpages through my program, zip it and e-mail it to you sothat you can check it out.
Ok, I think I found out why FireFox doesn't want to open the images. I've got a 'WebSites' directory in 'c:\'. In 'WebSites' I have asp.html with a directory 'ASP'. in ASP is a html file 'ASP Forms.htm'. When I click on the 'ASP Forms' link in asp.html, it goes there but in 'c:\WebSites\ASP\' I have a directory 'ASP Files' which contains images for 'ASP Forms.htm'. Now when FireFox enters 'ASP Forms.htm' is says (lets say it needs asp_image1.gif) "The file /C:/WebSites/ASP/ASP Files/asp_image1.gif cannot be found. Please check the location and try again." See the '/' before 'C:/WebSites/ASP/ASP Files/asp_image1.gif' ? Shouldn't it NOT be there?
I have set up these directories and files which corresponds to your description: [tit002:~] bfowler% ls -R /Users/bfowler/Sites/Bug\ 289875 ASP asp.html /Users/bfowler/Sites/Bug 289875/ASP: ASP Files ASP Forms.html /Users/bfowler/Sites/Bug 289875/ASP/ASP Files: asp_image1.png 'ASP Forms.html' contains the following: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Bug 289875</title> <meta name="generator" content="BBEdit 7.1.4"> </head> <body> <h1>Bug 289875</h1> <h2>Here is a picture of the North end of my beach ball</h2> <img src="ASP%20Files/asp_image1.png" alt="Beach ball" width="800" height="600"> </body> </html> This works for me. You might want to check your work in a visual editor such as Nvu.
Does asp.html have a link to 'ASP Forms.htm' ? If you go directly to 'ASP Forms.htm' then it will work, yes! But try going to 'ASP Forms.htm' through 'asp.html' via relative paths. Ok, I'm e-mailing my html files to you. Then you can tell me if its just me or if Firefox has a bug (no offence or anything). Its a 2.5MB RAR file, because I can only send 3MB of attachments through icqmail. Thanks for checking this out man!
I'll have to try sending it to you later. Sorry.
I really would not recommend sending 2.5 MByte of files to me or to anyone else. > But try going to >'ASP Forms.htm' through 'asp.html' via relative paths. That does not like HMTL to me. If I create a an asp.html with a link to 'ASP Forms.htm', what to do expect to happen. How does this differ from opening 'ASP Forms.htm' directly? Could I ask your question of you: Do you think that there is a a defect in Firefox? If so, could you state again the observed and expected behaviour (according to your comment 4 , comment 0 is now obsolete). If not, and if you do think that there is 'a bug' in your methods, you probably need to ask advice from a colleague or friend who can watch just what you do. I do assure that if there is a defect in Firefox (and you say that the behaviour in MAS/Linux is correct) then it will be investigated and resolved.
O.K. Here is my tentative stab at your asp.html: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Bug 289875 - asp.html</title> <meta name="generator" content="BBEdit 7.1.4"> </head> <body> <h1>Bug 289875 - asp.html</h1> <h2>Here is a picture of the North end of my beach ball</h2> <img src="ASP/ASP%20Files/asp_image1.png" title="ASP/ASP%20Files/asp_image1.png" alt="Beach ball" width="800" height="600"> <p><a href="ASP/ASP%20Forms.html">ASP Forms.html</a></p> </body> </html> This works for me.
you're using backslash i/o forward slash I'm pretty sure this is a wontfix bug, just can't find it whiteboard->DUPEME
Whiteboard: DUPEME
Ok, I've made a couple of screenshots for you guys to view. I've made it 256 color gif files, so excuse the low quelity but at least it shouldn't load that long. Just copy the link into your address bar(if you don't know how to open it) This is what its supposed to look like (via Internet Explorer): * http://img151.echo.cx/img151/5742/ie12zg.gif * http://img145.echo.cx/img145/3184/ie20sn.gif * http://img176.echo.cx/img176/4918/ie39np.gif This is what FireFox shows: * http://img151.echo.cx/img151/2815/firefox16wd.gif * http://img151.echo.cx/img151/2135/firefox20ru.gif * http://img205.echo.cx/img205/3130/firefox33yk.gif * http://img118.echo.cx/img118/7651/firefox49ug.gif
Ok, it looks like it made the links automatically. I didn't know that. Oh, and I saw I misspelled quality from "quelity". Probably just typed faster than I thoaght. Hope that those stuff helps. I've encircled the areas needed of attention with a red oval on the screen shots.
(In reply to comment #13) > ... > I've circled the areas needed of attention with a red oval on the screen shots. Lets concentrate on the second to last of your pictures. Would you attach to this report a short testcase: 2 or 3 lines of HTML which produce that error, the one that starts: 'The file /D:/... '?
Example source path : 'C:\Websites' c:\Websites\ This is in the index.html file: . . . <a href="ASP.html">ASP</a> . . . c:\Websites\ This is in the asp.html file: . . . <a href="ASP\ASP Forms.htm">ASP Forms.htm</a> . . . c:\Websites\ASP Then here is an image link from the ASP Forms.htm file: . . . <IMG height=20 alt=previous src="ASP Files/btn_previous.gif" width=100 border=0> . . . c:\Websites\ASP contains the 'ASP Files' folder
I am sure that I am missing something obvious, but in my quest to see the error for myself, I still haven't grasped how you managed to get the one I referred to, the one involving displayad.aspx . Your comment 15 looks rather like your comment 5 , and when I follwed the instructions in that one, I got pages that work. Do you know why you do not?
I have no idea. Its just weird. I tried this even on my machine @ home with the same version of FireFox and I still get those errors. I should try e-mailing those offline pages to you so that you can try and check it out yourself. What I can also do is, I've got an ftp server this machine but because of the gateway, etc. it changes my ip address (on the internet side). Maybe if you and I can use a chat prog. or something then you can identify my internet ip address and you can then access my ftp server to get those website pages. I dunno, which one seems easier? Unless you've got a file storage or something somewhere which I can use to upload to.
(In reply to comment #17) > I have no idea. Its just weird. My first suggestion would be for you to follow your instructions in comment 5 , compare those (fresh) pages with mine in comment 6 and comment 10 . If that brings no joy, perhaps you could create an archive and upload it to you http space something like http://img205.echo.cx/img205/3130/firefox-bug.zip
To all the Firefox guys who where involved with this bug, I give my sincerest apologies. The bug was after all my program's bug. It was just that IE, etc. just corrected the path of the link. Where my program generated a relative path link it made : "ASP\ASP Forms.htm" instead of "ASP/ASP Forms.htm". Because I used the pathSeparatorChar in Java to determine the separator character for the OS's path system. But it would have been nice if FireFox would just check for such stuff. Thanks Ben Fowler for your assistance and support and to you I say that I'm truly sorry for setting you up on a wild goose chase. I didn't know this untill a few minutes ago. Well atleast its 1 bug less to worry about ;) Thanks everyone and sorry!
Thanks for the update. I suggest resolving this as invalid. I am not sure that I really know what was going on. You will actually get better and faster help - user support - in Forums such as Mozallazine, but if you feel that there is a defect in Firefox, by all means check that it is reproducible, and open a Bug report. If you feel that comment 11 applies in full measure, then perhaps this needs to be added to the documentation for Web Authors.
At the time I didn't understand what the guy at comment 11 was talking about, but now (knowing what I did wrong) I do understand. Well Ben, you don't have to spend any more valuable time on this, since it was my fault but if you want to have the browser check if the slashes in the address bar or links are correct, then why not? Anyway, its the Mozilla programmer's decision. The thing was that, the bug I thought I descovered, I thoaght that the bug was with FireFox since it worked with IE, etc. An easy mistake to make. :( Thanks
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
You will probably find bugs open on those points. IIRC backslashes when typed on the command line are converted to entities, videlicet: http://localhost/~bfowler/weir\d_directory/index.html => http://localhost/~bfowler/weir%5Cd_directory/index.html Something similar occurs to backslashes in a page as my example shows. Of course, that is not valid markup, because the backslash should be URL-encoded. It is a little surprising that your tools allowed you to put a literal backslash into a Web page. Mine tried twice to stop me. My underlying system is BSD and is perfectly happy to name directories with a backslash, but such names (like many others) must be encoded when used within HTML or in circumstances where they might be interpreted. Think "leaning toothpicks"
> I did make the anchors for the links, but it looks like it stopped talking > about the protocol error thing so unfortionantly I can't give you the protocol > error message, but it did use the file:/// protocol to access hard-drive files. I think the error message was probably "e is not a registered protocol"; I'm getting it when I try to open an application from my cd drive. The application on the CD apparently has an HTML document as part of its boot sequence. This bug appeared for me when I downloaded the most recent version of Firefox to my C drive.
(In reply to comment #23) > I think the error message was probably "e is not a registered protocol"; Yes, so do I. > ... . This bug > appeared for me when I downloaded the most recent version of Firefox to my > C drive. Do you think it is a bug? If I type 'e://some/path/' into the URL bar, I get the 'not a registered protocol' message. Do you not?
Whiteboard: DUPEME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: