cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: curl and Javascript based submit form

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 1 Apr 2009 20:57:01 -0600

On Wed, Apr 01, 2009 at 07:58:40PM +0000, R B wrote:
> Any idea how I can use curl to download file from Javascript based submit
> button?
> Here is the form page(test.jsp) :
>
> <html>
> <head>
> <title>Untitled</title>
> <SCRIPT language="JavaScript1.2">
> function poponload()
> {
> var url='http://localhost:8080/test_20090319.zip';
> testwindow= window.open (url);
> }
> </script>
> </head>
>
> <body>
>
> <form method="GET" action="test.jsp" onsubmit="javascript:poponload()">

The JavaScript here basically co-opts the form and replaces it with a
plain GET of the url above. You should be able to download it with a
plain 'curl -O http://localhost:8080/test_20090319.zip' command. You may
need to enable cookies, set a referrer header and user-agent if not.

>>> 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-02