Is this ok?

K

Ken

Is this url ok?
Is it ok to have %20 in your url's??
ftp://www.******.com/Index/Code%20Samples/Code%20Samples%
20For%20Visual%20Basic/Search%20Spider.zip

Where ever I had a space in hte file name it now shows
a "%20" in the url, I can easly replace the space with
a "_" insted, should I or is it of like it is???

I don't know give me sone feed back on the %20 crap seams
to work fine with IIS 6.0...
 
K

Ken Schaefer

Spaces are not allowed in URLs (along with several other characters) -
please check the HTTP specification (or use google). Instead, they need to
be encoded, their encoded value is %20

Cheers
Ken

: Is this url ok?
: Is it ok to have %20 in your url's??
: ftp://www.******.com/Index/Code%20Samples/Code%20Samples%
: 20For%20Visual%20Basic/Search%20Spider.zip
:
: Where ever I had a space in hte file name it now shows
: a "%20" in the url, I can easly replace the space with
: a "_" insted, should I or is it of like it is???
:
: I don't know give me sone feed back on the %20 crap seams
: to work fine with IIS 6.0...
 
K

Ken Schaefer

: it's OK, but better avoided - the HTTP spec means spaces must be
: replaced with %20 in order to keep a URL contiguous and not confuse the
: client or server unduly.

No server will understand an request for a URI with a space in it.

AFAIK The only browser where spaces "work" is Internet Explorer, and this is
only because IE automagically encodes the spaces for you before it sends the
request out to the server.

Cheers
Ken
 
D

Dave Anderson

Ken Schaefer said:
AFAIK The only browser where spaces "work" is Internet Explorer,
and this is only because IE automagically encodes the spaces for
you before it sends the request out to the server.

The following browsers all encode the space. I cannot speak for others, but
I think it's safe to say anything with a version > 5 does the job:

Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2) Opera 7.11 [en]
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.4) Gecko/20030624
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; .NET CLR 1.1.4322; .NET
CLR 1.0.3705)
Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.5a) Gecko/20030728
Mozilla Firebird/0.6.1


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
D

Dave Anderson

Adrienne said:
What about other browsers or devices? Isn't it preferable to just
not use spaces in file naming conventions than have some browser
and/or device fail?

Possibly, but I wasn't passing judgment. I was merely responding to the
quoted text.

I admit I am a bit conflicted on the issue, however.

On one hand, I recognize that many of us have content that is managed by
contributors, some of whom are ignorant of -- or simply ignore -- these file
naming conventions. I don't want to police my contributors and I simply
don't care that much about the user with a vintage 1997 browser. To him, the
web is a stream of broken or crippled pages anyway.

On the other hand, I almost always defer to standards. And RFC1738 declares
URLs with spaces to be "unsafe".
http://www.ietf.org/rfc/rfc1738.txt

I personally have never used spaces in URLs. But I can't bring myself to
criticize those who do.

One further point to ponder -- the HTML spec warns users to always consider
URIs as case-sensitive, but this seems to be ignored with equal zeal.
http://www.w3.org/TR/html4/types.html#type-uri

Progress?


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
A

Adrienne

Possibly, but I wasn't passing judgment. I was merely responding to the
quoted text.

I admit I am a bit conflicted on the issue, however.

On one hand, I recognize that many of us have content that is managed
by contributors, some of whom are ignorant of -- or simply ignore --
these file naming conventions. I don't want to police my contributors
and I simply don't care that much about the user with a vintage 1997
browser. To him, the web is a stream of broken or crippled pages
anyway.

One can always provide instructions for the user, or reject a contribution
if it doesn't fall within your accepted naming conventions.

I actually wasn't talking about people with vintage browsers. I was
talking about people with other kinds of devices, telephones, things that
haven't been invented yet, etc.
On the other hand, I almost always defer to standards. And RFC1738
declares URLs with spaces to be "unsafe".
http://www.ietf.org/rfc/rfc1738.txt

Thanks for posting that. I read it and it corrected a misconception I had.
I was under the impression that dashes in file names were unsafe as well,
but apparently they are not, and some search engines seem to be able see
keywords in URIs like www.example.com/hotels-paris-france.asp.
I personally have never used spaces in URLs. But I can't bring myself
to criticize those who do.

One further point to ponder -- the HTML spec warns users to always
consider URIs as case-sensitive, but this seems to be ignored with
equal zeal. http://www.w3.org/TR/html4/types.html#type-uri

Progress?

Hey, I'm lazy, and I'm sure that my Shift keys have some other, more grand
purpose in the scheme of life.
 
P

Phillip Windell

I personally have never used spaces in URLs. But I can't bring myself to
criticize those who do.

Hey for a "buck" and a bottle of cold Pepsi I will!.....stand back
everybody! :)
One further point to ponder -- the HTML spec warns users to always consider
URIs as case-sensitive, but this seems to be ignored with equal zeal.
http://www.w3.org/TR/html4/types.html#type-uri

By what means do the contributors contribute? Maybe there is a way to
filter/reject things that aren't formated properly and distribute
instructions for the proper way to contribute. The problem isn't
going to go away if you don't do something to prevent it.


--

Phillip Windell [CCNA, MVP, MCP]
(e-mail address removed)
WAND-TV (ABC Affiliate)
www.wandtv.com
 
D

Dave Anderson

Phillip Windell said:
By what means do the contributors contribute? Maybe there
is a way to filter/reject things that aren't formated
properly and distribute instructions for the proper way
to contribute. The problem isn't going to go away if you
don't do something to prevent it.

Who said it was a problem? It bothers me to no extent whatsoever. As I said,
I choose not to police contributors.

The determination that a URL is not well-formed seems to be an arbitrarily
drawn conclusion. Spaces are certainly allowed in quoted attributes, if not
in URLs. But if

http://xx.com/my file.xxx

is an invalid URL and

http://xx.com/my file.xxx

is valid, and furthermore

"http://xx.com/my file.xxx"

is a valid HTML attribute value (because it is simple quoted text), should
it not be the responsibility of the browser to apply the proper encoding to
the attribute value when choosing to use it as a URL? The web server, after
all, has the responsibility for the reciprocal mapping to the original
filename (the one with the space included).

FWIW, I note that as I typed this, my NG client identified the quoted
attribute as a URL spanning the space, but not the unquoted example. This
perfectly illustrates my point. Once the text is put into context (in this
case, to be treated as a URL), the client, which happens not to be a
browser, properly encodes the text.


--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 
A

Adrienne

FWIW, I note that as I typed this, my NG client identified the quoted
attribute as a URL spanning the space, but not the unquoted example.
This perfectly illustrates my point. Once the text is put into context
(in this case, to be treated as a URL), the client, which happens not
to be a browser, properly encodes the text.

Well, that may be well and good for Outlook Express, but it certainly does
not work for me.

"http://www.example.com/my file.htm" is underlined as far as my, and no
farther.

Additionally, when I send myself a message to my web mail account, it also
understands until the my and no farther.

However, using the %20 in place of the space will resolve, although there
is no such file at www.example.com .

Not everyone uses Outlook Express.
 
D

Dave Anderson

Adrienne said:
Not everyone uses Outlook Express.

That's immaterial to my point. Context should be what matters. Do you know
of a browser or device that interprets HTML, but disallows spaces in quoted
attribute values?

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms. Please do not contact
me directly or ask me to contact you directly for assistance. If your
question is worth asking, it's worth posting.
 

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

No members online now.

Forum statistics

Threads
474,113
Messages
2,570,688
Members
47,269
Latest member
VitoYwo03

Latest Threads

Top