cURL / Mailing Lists / curl-users / Single Mail


Whitespace in a Location: Hint

From: Sarnicola, Anthony (Exchange) <>
Date: Fri, 14 Jun 2002 17:19:39 -0400

I'm not sure if there's an option I'm missing or if this is a problem. I
am using the command line curl to get a file that has a space in the
filename. I request it from the server URL encoded. But the server sends
back a Location hint with a space rather than %20. When curl attempts the
next GET, the filename is truncated at the space and the server (correctly)
responds with a 404 Not Found error. Any help is appreciated.

I'm running curl like this:

curl -N -L -b ./cookies -c ./cookies -A "Mozilla/4.0 (compatible; MSIE 5.01;
WindowsNT)" -H "Accept: application/, application/msword,
application/, image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, */*" --trace-ascii ./trace -O

The trace output looks like this:

0000: GET /My%20File.doc HTTP/1.1
0029: User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; WindowsNT)
0065: Host:
0083: Pragma: no-cache
0095: Cookie: DocCookie=3b14360f381b4a44
00b8: Accept: application/, application/msword, applicatio
00f8: n/, image/gif, image/x-xbitmap, image/jpeg, ima
0138: ge/pjpeg, */*
<= Recv header, 105 bytes (0x69)
0000: Location: File
0040: .doc?&STCO=1PQpV-M_at_i4CwAAGNMb2c&STCOEND
<= Recv header, 19 bytes (0x13)
0000: Connection: close
<= Recv header, 45 bytes (0x2d)
0000: Content-Type: text/html; charset=iso-8859-1
== Info: Follow to new URL:
== Info: Closing connection #0
== Info: Follows Location: to new URL: ''
0000: GET /My HTTP/1.1
0014: User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; WindowsNT)
0050: Host:
006e: Pragma: no-cache
0080: Cookie: FDX=PQpV-M_at_i4CwAAGNMb2c; DocCookie=6b503b663d5f447e
00bc: Accept: application/, application/msword, applicatio
00fc: n/, image/gif, image/x-xbitmap, image/jpeg, ima
013c: ge/pjpeg, */*
<= Recv header, 24 bytes (0x18)
0000: HTTP/1.0 404 Not Found

Bear Stearns is not responsible for any recommendation, solicitation,
offer or agreement or any information about any transaction, customer
account or account activity contained in this communication.


Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -
Received on 2002-06-14