cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: cURL Downloading attachment from a forum php script

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 20 Jun 2011 22:54:26 -0700

On Tue, Jun 21, 2011 at 12:30:02AM +0200, Damian Win wrote:
> The problem is that download doesnt start or I don't know how to make it work
> because it's not just url to file but to php script which normally triggers
> download  in browser.
>
> < HTTP/1.1 200 OK
> < Server: nginx
> < Date: Mon, 20 Jun 2011 21:57:08 GMT
> < Content-Type: video/mpeg
> < Content-Length: 253722
> < Last-Modified: Mon, 28 Jun 2004 21:41:05 GMT
> < Connection: close
> * Replaced cookie session_id........
> < Set-Cookie: .......
> < Content-Disposition: inline; filename="FILE.MPG"
> < P3P: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
> * Replaced cookie ....
> < Set-Cookie: X-Backend=web5; path=/
> < X-Backend: web5
> < X-Protocol: http
> < X-Country: XX
> < Accept-Ranges: bytes
> <
> * Closing connection #0
>
>
> So, why download doesnt start. The buffer is empty but respone looks ok.

This header shows that there are 253722 bytes of data to come. libcurl
should be calling the write callback to store that data as it is downloaded.
You didn't provide the source to that callback, but if it's based on
getinmemory.c, then PageData.memory should be a pointer the downloaded data
once curl_easy_perform returns.

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