cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: download a file like in popup-dialog?

From: Alan Wolfe <alan.wolfe_at_gmail.com>
Date: Wed, 4 May 2011 14:29:54 -0700

there may be some trickery in the download dialog - like it uses
javascript to fire off the download.

if so, you need to figure out what the final URL of the file you are
actually getting is, and do a curl request to that file location.
(View the page source to figure out what's going on)

they may have things in place to thwart your attempts like session
keys that expire after a certain amount of time and stuff like that
but yeah... hopefully this is some help to you :P

On Wed, May 4, 2011 at 2:18 PM, Alexander Wieck <postaw_at_arcor.de> wrote:
> Hello,
>
> i'm looking for a solution to download a file from an asp-site.
> With Firefox i press OK in the Download-Dialog-Popup and get the file, but with the curl-examples like ftpget.c or getinmemory.c i don't get the file.
>
> Here my log:
> ##########################################################
> * About to connect() to 47.11.08.15 port 80 (#0)
> *   Trying 47.11.08.15... * connected
> * Connected to www.unknown.org (47.11.08.15) port 80 (#0)
>> GET /getfilewithno.aspx?id=4711 HTTP/1.1
> Host: www.unknown.org
> Accept: */*
>
> < HTTP/1.1 200 OK
> < Cache-Control: private
> < Server: Microsoft-IIS/7.5
> < Set-Cookie: ASP.NET_SessionId=1ck5je45j3sqad2qejttziy4; path=/; HttpOnly
> < Content-Disposition: attachment; filename=file4711.txt
> < X-AspNet-Version: 2.0.50727
> < X-Powered-By: ASP.NET
> < Date: Wed, 04 May 2011 18:26:55 GMT
> < Content-Length: 0
> <
> * Connection #0 to host www.unknown.org left intact
> * Closing connection #0
> ##########################################################
>
> Is there an curl-example for handle this download-dialog?
> many thx
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette:  http://curl.haxx.se/mail/etiquette.html
>

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-05-05