cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Help with curl & forms

From: Brad Demers <bjdemers76_at_yahoo.ca>
Date: Wed, 18 Feb 2009 14:00:18 -0800 (PST)

Hello,

Thank you for the reply. I've tried a few things but I'm still not having any luck.

LiveHTTPHeaders output, for example:

http://holiday.________.com/admin/photoupdate_upload.asp?aiid=102425
POST /admin/photoupdate_upload.asp?aiid=102425 HTTP/1.1
Host: holiday._____.com
User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13
Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
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
Referer: http://holiday.______.com/admin/photoupdate.asp?aiid=102425
Cookie: ASPSESSIONIDQQQRRQSA=KHAKMFMDMIGEBKDCIFDCKJHH
Content-Type: multipart/form-data; boundary=---------------------------152558661417269599651774642550
Content-Length: 67226
-----------------------------152558661417269599651774642550
Content-Disposition: form-data; name="filefield"; filename="test1.jpg"
Content-Type: image/jpeg

Returns with:
HTTP/1.x 302 Object moved

So via Firefox or Safari it seems to run fine.

However, the cURL trace:

== Info: About to connect() to holiday._____.com port 80 (#0)
== Info: Trying 216.***.**.**... == Info: connected
== Info: Connected to holiday._____.com (216.***.**.**) port 80 (#0)
=> Send header, 448 bytes (0x1c0)
0000: POST /admin/photoupdate_upload.asp?aiid=102425 HTTP/1.1
0039: User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-U
0079: S; rv:1.9.0.6)
0089: Host: holiday.ospreyauction.com
00aa: Accept: */*
00b7: Referer: http://holiday._____.com/admin/photoupdate.asp?
00f7: aiid=102425
0104: Cookie: ASPSESSIONIDQQQRRQSA=NIPEJFMDHOFHMOALLFKCHJFG
013b: Content-Length: 67175
0152: Expect: 100-continue
0168: Content-Type: multipart/form-data; boundary=--------------------
01a8: --------ac591bde8680
01be:
<= Recv header, 23 bytes (0x17)
0000: HTTP/1.1 100 Continue
<= Recv header, 27 bytes (0x1b)
0000: Server: Microsoft-IIS/5.0
<= Recv header, 37 bytes (0x25)
0000: Date: Wed, 18 Feb 2009 21:30:49 GMT
=> Send data, 261 bytes (0x105)
0000: ------------------------------ac591bde8680
002c: Content-Disposition: form-data; name="aiimage2"
005d:
005f: pj218200942453PM.jpg
0075: ------------------------------ac591bde8680
00a1: Content-Disposition: form-data; name="filefield"; filename="test
00e1: 1.jpg"
00e9: Content-Type: image/jpeg
0103:
=> Send data, 16384 bytes (0x4000)

=> Send data, 16384 bytes (0x4000)
=> Send data, 16384 bytes (0x4000)
=> Send data, 16384 bytes (0x4000)
=> Send data, 1330 bytes (0x532)
=> Send data, 48 bytes (0x30)
0000:
0002: ------------------------------ac591bde8680--
<= Recv header, 36 bytes (0x24)
0000: HTTP/1.1 500 Internal Server Error
<= Recv header, 27 bytes (0x1b)
0000: Server: Microsoft-IIS/5.0
<= Recv header, 37 bytes (0x25)
0000: Date: Wed, 18 Feb 2009 21:30:50 GMT
<= Recv header, 21 bytes (0x15)
0000: Content-Length: 351
<= Recv header, 25 bytes (0x19)
0000: Content-Type: text/html
<= Recv header, 24 bytes (0x18)
0000: Cache-control: private
<= Recv header, 2 bytes (0x2)
0000:
<= Recv data, 351 bytes (0x15f)

Any idea if the Keep-Alive: 300/Connection: keep-alive through a browser versus the 0152: Expect: 100-continue in cURL could have anything to do with it?

I'm really scratching my head over this...

________________________________
From: Daniel Stenberg <daniel_at_haxx.se>
To: the curl tool <curl-users_at_cool.haxx.se>
Sent: Wednesday, February 18, 2009 5:03:09 AM
Subject: Re: Help with curl & forms

On Tue, 17 Feb 2009, Brad Demers wrote:

> curl -b cookies.txt -F "filefield=@/test1.jpg" -F "aiimage2=cj216200993826PM.jpg" http://holiday.____.com/admin/photoupdate_upload.asp

> < HTTP/1.1 500 Internal Server Error
> < Server: Microsoft-IIS/5.0
> Microsoft OLE DB Provider for ODBC Drivers
> error '80040e14'
> [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect syntax near '='.

I would compare a LiveHTTPHeaders output with a curl --trace-ascii logfile to make sure the requests are as similar as possible.

-- 
/ daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
      __________________________________________________________________
Yahoo! Canada Toolbar: Search from anywhere on the web, and bookmark your favourite sites. Download it now at
http://ca.toolbar.yahoo.com.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-02-18