Msg#: 4314501 posted 5:37 am on May 19, 2011 (gmt 0)
My assistant uploaded to the file server some images with names like "image name 1.jpg" containing spaces. She then added the images to a webpage using the <img src=> tag. I always thought spaces were not allowed in file names.
But then, I viewed the web page with browsershots.org and every browser that could show the image did show the image. Are there any reasons for not using a space in an image file name?
Msg#: 4314501 posted 7:30 am on May 19, 2011 (gmt 0)
Some browsers will treat the spaces as spaces. Some will collapse them. Some will demand that you express them as %20. Better to play it safe and stick with alphanumerics-- case sensitive-- and lowlines.
Msg#: 4314501 posted 6:23 pm on May 19, 2011 (gmt 0)
Spaces never used to resolve, on servers, some operating sysyems, or browsers, for file names (who remembers the 8/3 rule? :-) ) Both have gotten pretty good at resolving it, but I encountered something just the other day that says it's still unsafe practice.
I am setting up a CMS for a client. They were playing with it, and sure enough - A "File Name Is like a small text editor, right.jpg" comes along. The CMS encodes the file name to make it database safe and you get a literal File%20Name%20Is%20like%20a%20small%20text%20editor,%20right.jpg for a file name in the database.
Spaces still cause problems, as does CaseSensiTivity. Form a standard with files, something other people do so if you ever call someone in they will do the same thing. Lower case and no spaces for file names. Underscores lead to underscores in published files, and that's not a good habit to form* (though it's not a death knoll, dashes are better.)