By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,908 Members | 1,860 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,908 IT Pros & Developers. It's quick & easy.

Escaping filename in http response

P: n/a
I know I *could* look this up in the relevant RFC... but I thought
someone might know it off the top of their head.

I'm offering files for download via a CGI. I am inserting the filename
into the relevant http header. Where the filename contains spaces
firefox truncates it - which is probably correct behaviour for firefox
- but annoying :-)

Which is the right function to escape the filename urllib.quote or
urllib.quote_plus ?

It's probably quote_plus....... (and I'll probably try both later...
but someone might answer before that)

:-)

Thanks
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml

Jul 18 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"Fuzzyman" <fu******@gmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Which is the right function to escape the filename urllib.quote or
urllib.quote_plus ?


Neither. Just drop quotes around it, after having sanitized it
(assuming it's plain ASCII). Alternatively you could use the
email package for MIME stuff like this.
Jul 18 '05 #2

P: n/a
Nice one - thanks.

Fuzzy
http://www.voidspace.org.uk/python/index.shtml

Jul 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.