cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl dowload from a post form

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 31 Mar 2009 23:14:06 -0600

On Tue, Mar 31, 2009 at 05:46:28PM +0000, R B wrote:
> I need to download a zip file from a page like the following :
> <form method="post" action="testfile.zip" >
> <input type="submit" name="download" value="OK"/>
> </form>
>
> I want to use curl to click on download button and download the file (The name
> of the zip file is not known and changes everyday, that's why I need to do
> something like this)
> I tried the following, but curl just returns the page html, and not the zip
> file
>
> curl -O -k -d "download=OK" "http://localhost:8080/test/download.jsp"

The "action" attribute specifies the URL to POST to. Your URL should
probably be something like http://localhost:8080/test/testfile.zip

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
-------------------------------------------------------------------
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-04-01