cURL / Mailing Lists / curl-users / Single Mail

curl-users

Post a file to a URL

From: Will Weatherford <fiveweatherfords_at_gmail.com>
Date: Thu, 18 Oct 2007 09:06:24 -0400

cURL Users,

     I am trying to post a file to a URL (hosted by a printer) via cURL.
When I do it through FireFox with HTTPHeadaers on I get:

http://157.184.32.21/cgi-bin/importfile/cgi-bin/dynamic/config/secure/importsettings.html

POST /cgi-bin/importfile/cgi-bin/dynamic/config/secure/importsettings.html
HTTP/1.1
Host: 157.184.32.21
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: 1.8.1.7)
Gecko/20070914 Firefox/2.0.0.7
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://157.184.32.21/cgi-bin/dynamic/config/secure/importsettings.html

Content-Type: multipart/form-data;
boundary=---------------------------19074277212554
Content-Length: 253
-----------------------------19074277212554
Content-Disposition: form-data; name="input_file"; filename=" V34False.ucf"
Content-Type: application/x-download

// anything

mfp.fax.enableV34 "false"

-----------------------------19074277212554--

HTTP/1.x 200 OK
Content-Type: text/html
----------------------------------------------------------
http://157.184.32.21/cgi-bin/dynamic/config/gen/importexport.html

GET /cgi-bin/dynamic/config/gen/importexport.html HTTP/1.1
Host: 157.184.32.21
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.7)
Gecko/20070914 Firefox/2.0.0.7
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://157.184.32.21/cgi-bin/importfile/cgi-bin/dynamic/config/secure/importsettings.html

HTTP/1.x 200 OK
Expires: Sun, 27 Feb 1972 08:00:00 GMT
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html

I have tried posting the file V34True.ucf with this command:

"C:\Boeing\curl.exe" --max-time 6 -F
input_file=@"C:\Boeing\V34True.ucf;type=multipart/form-data"
http://157.184.31.21/cgi-bin/dynamic/config/secure/importsettings.html >
"C:\Boeing\V34TrueUCFOutput.txt"

The contents of V34True.ucf:

// anything

mfp.fax.enableV34 "true

This is what I get when I run the command from the DOS box:

C:\Boeing>"C:\Boeing\curl.exe" --max-time 6 -F
input_file=@"C:\Boeing\V34True.uc
f;type=multipart/form-data"
http://157.184.31.21/cgi-bin/dynamic/config/secure/
importsettings.html > "C:\Boeing\V34TrueUCFOutput.txt"

curl: (28) connect() timed out!

C:\Boeing>

Any advice on posting this file would be appreciated.
Received on 2007-10-18