cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-users Mailing List Archives

help with form fill

From: Pullus Cuetlachtli <pullusum_at_gmail.com>
Date: Wed, 26 Mar 2008 12:00:41 +0200

Hi
I need your help please for following form completion.. I need send
file with POST to site. Form is looked as:

<form name="swf" method=POST enctype="multipart/form-data"
action="/90?swsessioncookie=T2WVUW2-DsgX5eJ-uJ7LuE">
<table width=100% border=0 cellpadding=0 cellspacing=0><tr
class=PageTH><td width="40"><img border=0 src="/img2/ptl.gif"></td><td
align=left nowrap class=Header>Firmware Update
</td><td align=right width="40"><img border=0
src="/img2/ptr.gif"></td></tr><tr class=PageTR><td>&nbsp;</td><td
height="300" valign=top>
        <br>
        <center>
        <table border=0 cellspacing=0 cellpadding=3 class=Tab width="635">

        <tr class=TabHead><th>Firmware Update</th></tr>
        <tr class=TabRow0><td>To update the UTM-1 Edge's firmware, follow
these steps:<ol>
<li>Obtain the updated firmware file.<li>Click <b>Browse...</b> and
select the new firmware file.</li><li>Click
<b>Upload</b>.</li></td></tr>
        <tr class=TabRow0><td align=center><input type=file name="policy"></td></tr>

        </table>
        </center>
        <br>
</td><td>&nbsp;</td></tr><tr class=PageTB><td><img border=0
src="/img2/pbl.gif"></td><td align=center><table
border=0><tr><td>&nbsp;</td>
        <td><script>createButton("firmupdate", "Upload",
"javascript:send();");</script></td>
        <td><script>createButton("firmupdatecnl", "Back",
"javascript:location='"+menuAdvItems[0][2]+"';");</script></td>
</tr></table></td><td align=right><img border=0
src="/img2/pbr.gif"></td></tr></table>

I've used livehttpheaders and catched this:

browser:
POST /90?swsessioncookie=WkrD6TP-x5qkOpc-OAOkbU HTTP/1.1
Host: 123.123.123.123:981
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12
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: https://123.123.123.123:981/Firmware_update.html
Cookie: session=WkrD6TP-x5qkOpc-OAOkbU
Authorization: Basic YWRtaW46cGFzc3dvcmQ=
Content-Type: multipart/form-data;
boundary=---------------------------10852243853536
Content-Length: 211
-----------------------------10852243853536
Content-Disposition: form-data; name="policy"; filename="xxxxx.img"
Content-Type: application/octet-stream

imgimg
-----------------------------10852243853536--

I use https with port 981. This script I did - didn't work:
curl -A "Mozilla/5.0" -b cookies.txt -c newcookies.txt -k -u
admin:password -F policy=@xxxx.img
https://123.123.123.123:981/Firmware_update.html

I think it something wrong with cookies. If you need additional info,
I can supply.
Thanks!

--
S.Serov
Received on 2008-03-26

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET