Why can some browsers read filenames with spaces.

E

Edison Carter

Got a question.

A website that I went to, i clicked on a small thumbnail image for the
larger image gave me a 404 not found, i told the webmaster and he said
it worked fine for him and he had someone else try it and it worked,
but i had someone try and it 404'd for them also..

the thumbnail was linked to a jpg with spaces in the directory and
filename.. i know that has to be the problem, but whats the cause.?

I heard it can be that some browsers can add a %20 properly, and some
cant, im curious to this info as to what browsers this can ocour on.,
thanks.
 
B

brucie

A website that I went to, i clicked on a small thumbnail image for the
larger image gave me a 404 not found, i told the webmaster and he said
it worked fine for him and he had someone else try it and it worked,
but i had someone try and it 404'd for them also..

the thumbnail was linked to a jpg with spaces in the directory and
filename.. i know that has to be the problem, but whats the cause.?

Uniform Resource Identifiers (URI): Generic Syntax
2.4.3. Excluded US-ASCII Characters
The space character is excluded because significant spaces may
disappear and insignificant spaces may be introduced when URI are
transcribed or typeset or subjected to the treatment of word-
processing programs. Whitespace is also used to delimit URI in many
contexts.

E. Recommendations for Delimiting URI in Context
[...]
In some cases, extra whitespace (spaces, linebreaks, tabs, etc.) may
need to be added to break long URI across lines. The whitespace
should be ignored when extracting the URI.
[...]
For robustness, software that accepts user-typed URI should attempt
to recognize and strip both delimiters and embedded whitespace.

Uniform Resource Identifiers (URI): Generic Syntax
http://www.ietf.org/rfc/rfc2396.txt

thats basically the main points. the RFC has more on spaces if you
want to read it.

if you want to use spaces in file names URL etc - don't. if you really
think you must then still don't. if your life depends on it use the
escaped encoding of %20 and accept it will not always work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top