OT: web design again, and an oddity

Nov 03, 2012 34 Replies
Saved reading
Jump to replies (34)

I've been bashing on with the redesign of my outdated website, learning at least the basics of CSS and trying to get rid of all (or most) of the bad habits I picked up first time round. Fascinating stuff, if frequently distinctly frustrating.



One thing has floored me completely. in my /images/ directory I had several sets of two files, named like this:



bill_and_ben_thumbnail.jpg



bill_and_ben.jpg



and I wrote a gallery page with the thumbnail pictures set up as clickable links to the larger versions. Most of these worked a treat, but one wouldn't co-operate: the larger file wouldn't open. It worked offline but not once uploaded. Absolutely nothing was changed during the uploading.



However, I discovered that if I renamed the larger image billandben.jpg (and changed the link to match) then it opened perfectly.



I've never come across that before. Is it a well-known quirk?



Bert


By and large linux based web servers will be case sensitive, could that be it? Or some odd-ball character set used for the filename perhaps?

They also barf at spaces in file and directory names.

I learnt very quickly to only use the approved characters and avoid spaces in file and directory names...

John and Andy, thanks for the speedy replies. No spaces, no strange characters, all lower-case: the actual filename concerned was clive_and_michael.html .

It opened from my hard disk, both directly and as a result of clicking the link on the offline webpage. But once uploaded it wouldn't open at all, either from the link on the uploaded page or directly from an online file listing.

It's really rather baffling.

Bert

Are you using relative links in your pages or absolute ones?

This:-

is portable between machines, and will work on any server, as long as the webpage has the /images directory below it within the same tree.

This:-

Isn't and won't.

There may be a setting in your composer that needs sorting out.

I'm afraid I don't know. Before I changed it, the relevant line was:

All the other thumbnails are coded in exactly the same way (though with different file details, obviously) and they all worked (and still work) just fine. But there's something about that one filename...

Ber

I had a similar problem once which caused similar confusion and it actually turned out to be a problem with Firefox. Simply clearing the Firefox cache was enough for it to refresh itself and see the missing image file on my site.

My guess is that it was cached in your browser. As a null image You changed its name and the cache was circumvented.

Its VERY important of a change on the server doesn't seem to be being picked up by the browser, clear the cache. Or close and restart the browser.

spaces are fine - replace with %20 in the url.

slashes are not, though :-)

I think that you and David in Normandy have it. I just tried changing the filename back and all was fine. Presumably all the to-ing and fro-ing I'd done in the interim (while the changed name was active) had cleared the decks a bit. Or something.

Anyway, the name is now in line with all the other image files and I can relax and stop twitching.

Many thanks to all who chipped in.

Bert

Check that the read permissions are set correctly on the server version.

(By default I create files without world readable permission. Sometimes I forget to change permission before uploading a new file; even if a replacement file has the same name and read permission set it will acquire the incorrect read permission of the original file on upload.)

Underscores shouldn't be a problem. Did you have them in other filenames which *do* work?

It seems likely to me that there may have been a discrepancy between the actual filename and the filename contained in the link - which your offline system didn't mind but the web server did. Such things as different case, or .htm in one and .html in the other, for example.

The normal cause of this is a filename that does not match the destination but only differs in case. Windows remembers the case of filenames when saved, but does not care about exact matches on opening.

*nix as probably used by your web server, however does care.

yup.

At least you are giving them useful names, many sites call their pictures daft things like aejei33kdj.jpg and then don't use an alt tag so one has no idea what they were supposed to be. Brian

Yes, why do you think there are no spaces in web addresses. I also tend not to use underscores, but sometimes you have to. I notice when addresses are published in some papers, the underscores vanish mysteriously. I strongly suspect that this is due to them removing underscores from the underlined address in their entirety. Brian

Or in IE, click the "refresh" icon whilst holding CTRL, it forces a refresh and bypasses the cache.

Very important to do these things during final testing before going "live" with a site, it may work 100% on your machine but doesn't work on anyone else's!

This is why I always check such things using a different machine.

I've been checking as I go, on three different PCs (all with different screen resolutions) and with four different browsers. No really big problems so far.

I'd like to try a smart phone and maybe an iPad or similar, but unless some benefactor of the arts decides to send me one of each it isn't going to happen...

Bert

You can download Virtual Box and a copy of Android and run that on your PC. Not at all sure how well that represents a real smartphone environment.

In the absence of actual phones and tablets, in firefox you can at least simulate the different screen sizes and rotation with web developer responsive design tools (ctrl-shift-m)

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required