cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: Download files from HTTP

From: <Chi.Hsiang.Chih_at_fortisinvestments.com>
Date: Thu, 30 Oct 2008 17:59:04 +0100

Ralph,
 
Thank you for the tip. I'm new to CURL, but find it great tool.
 
Now I'm able to logon with cookies and redirection.
curl -L -c newcookies.txt -d
"email=scott.tiger%40company.com&password=PASSWD" -x webproxy:8080
http://edw.morningstar.com/login.aspx/login.aspx
 
But still can't download the file. What am I doing wrong?
curl -L -O -c newcookies.txt -x webproxy:8080
http://edw.morningstar.com/download.aspx?action=ExtendedMasterlist
<http://edw.morningstar.com/download.aspx?action=ExtendedMasterlist>
 
The trace info:
== Info: About to connect() to proxy webproxy port 8080 (#0)
== Info: Trying 11.191.161.99... == Info: connected
== Info: Connected to webproxy (11.191.161.99) port 8080 (#0)
=> Send header, 253 bytes (0xfd)
0000: GET http://edw.morningstar.com/download.aspx?action=ExtendedMast
0040: erlist HTTP/1.1
0051: User-Agent: curl/7.19.0 (i386-pc-win32) libcurl/7.19.0 OpenSSL/0
0091: .9.8h zlib/1.2.3
00a3: Host: edw.morningstar.com
00be: Pragma: no-cache
00d0: Accept: */*
00dd: Proxy-Connection: Keep-Alive
00fb:
<= Recv header, 17 bytes (0x11)
0000: HTTP/1.1 200 OK
<= Recv header, 23 bytes (0x17)
0000: Via: 1.1 BE-S0403-MS2
<= Recv header, 24 bytes (0x18)
0000: Connection: Keep-Alive
<= Recv header, 30 bytes (0x1e)
0000: Proxy-Connection: Keep-Alive
<= Recv header, 19 bytes (0x13)
0000: Content-Length: 0
<= Recv header, 37 bytes (0x25)
0000: Date: Thu, 30 Oct 2008 16:56:46 GMT
<= Recv header, 27 bytes (0x1b)
0000: Server: Microsoft-IIS/6.0
<= Recv header, 23 bytes (0x17)
0000: X-Powered-By: ASP.NET
<= Recv header, 29 bytes (0x1d)
0000: X-AspNet-Version: 2.0.50727
<= Recv header, 24 bytes (0x18)
0000: Cache-Control: private
<= Recv header, 2 bytes (0x2)
0000:
== Info: Connection #0 to host webproxy left intact
== Info: Closing connection #0

Thank you

Regards, Chi

 

________________________________

From: curl-users-bounces_at_cool.haxx.se
[mailto:curl-users-bounces_at_cool.haxx.se] On Behalf Of Ralph Mitchell
Sent: donderdag 30 oktober 2008 4:08
To: the curl tool
Subject: Re: Download files from HTTP

On Thu, Oct 30, 2008 at 9:30 AM, Qi Xiang Chi <qi_xiang_chi_at_hotmail.com>
wrote:

        In internet explorer I can download the files by:
        1. Logon to the site:
        
http://edw.morningstar.com/login.aspx?email=scott.tiger@company.com&pass
word=PASSWD
        2. Download the file:
        
http://edw.morningstar.com/download.aspx?action=ExtendedMasterlist
         
        I was asked to automate download process by using CURL, but I
can't get the login right.
        I tried the following:
        curl -u scott.tiger_at_company.com:PASSWD -x webproxy:8080
http://edw.morningstar.com/login.aspx
        curl -form-string scott.tiger_at_company.com;PASSWD -x
webproxy:8080 http://edw.morningstar.com/login.aspx
        curl --form-string email=scott.tiger_at_company.com;password=PASSWD
-x webproxy:8080 http://edw.morningstar.com/login.aspx
        curl -F email=scott.tiger_at_company.com;password=PASSWD -x
webproxy:8080 http://edw.morningstar.com/login.aspx
         
        How can I logon to the site?
        Any help is welcome. Thanks.

At the very least, you probably need to save/send cookies. There's a
lot of useful information here:

     http://curl.haxx.se/docs/httpscripting.html

Ralph Mitchell

-------------------------------------------------------------------
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 2008-11-01