cURL / Mailing Lists / curl-users / Single Mail


Problem down loading a file with curl. Has anybody run into this problem before.

From: Vosberg, Mark <>
Date: Mon, 13 Sep 2010 14:50:45 -0500

I am trying to dowload a file via https with curl. The site is running IIS and asp. I am able to login to the site and navigate to the download directory but when I try to download the file it errors out with Object+reference+not+set.

The download works in firefox. After I login I just paste the pathname of the file. I get a popup download prompt and then I can save the file. Any ideas?

My Curl session has the same cookies defined as firefox session.

curl -i -v --insecure -L --trace-ascii trace4.out \
-b ./cook -c ./cook -o o4 \

This is some of the header info from the trace file.
=> Send header, 897 bytes (0x381)
0000: GET /WIPortal/Trade%20Files/Get%20Download%20File/tabid/138/Defa
0040: ult.aspx?Filename=54303307_54280017_ACCBBCF7_271X12BATCH_3307034
0080: HTTP/1.1
Plus cookies are sent.

Response from server
<= Recv header, 20 bytes (0x14)
0000: HTTP/1.1 302 Found
<= Recv header, 24 bytes (0x18)
0000: Connection: Keep-Alive
<= Recv header, 21 bytes (0x15)
0000: Content-Length: 259
<= Recv header, 13 bytes (0xd)
0000: Expires: -1
<= Recv header, 37 bytes (0x25)
0000: Date: Wed, 08 Sep 2010 15:51:19 GMT
<= Recv header, 146 bytes (0x92)
0000: Location:
0040: ?tabid=138&error=Object+reference+not+set+to+an+instance+of+an+o
0080: bject.&content=0

Any suggestions would be appreciated.

Here is the LiveHttp Header info from firefox. After login I just go get the file.

GET /WIPortal/Trade%20Files/Get%20Download%20File/tabid/138/Default.aspx? HTTP/1.1
User-Agent: Mozilla/5.0 (X11; U; HP-UX ia64; en-US; rv: Gecko/20100503 Firefox/3.5.9
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Cookie: .ASPXANONYMOUS=HLFJ4gKKywEkAAAANzIwMzQxYzEtNTFlMi00MGZhLWIyODMtNTQ0OWIyNzk1MTI10; language=en-US; .iCWIPortal=35D618538DA5C49E99D1C140D60D79F32FD7F37E9531BB81D0E405E8B06FA43CA52727A1341A4A61FF3D9655302BD5E64DABFC7C73A6E2D24C89CCBD30026ACDBA839BB0E645C89AE6199520D1B3A5D96D608A696A647B0F; ISAWPLB{43225E5A-60FA-4609-91A5-9135D4948D79}={4D72FDD3-0F1A-4197-A6C8-497F7D82BCDF}; ASP.NET_SessionId=eebixn55brxmbz55atch0r45; iCWindowID=3; iCSessionGUID=d4bc71d4-46e3-48e6-aa90-93a5503c83f7

HTTP/1.1 200 OK
Connection: Keep-Alive
Content-Length: 1542
Date: Mon, 13 Sep 2010 18:28:02 GMT
Content-Type: application/octet-stream
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Content-Disposition: attachment;
Cache-Control: private

List admin:
Received on 2010-09-13