curl and download

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I used curl a few times now, and it always worked fine... but now I
have a little question:

If I post to a certain url , and that page returns a file for download.
(it doesn't display anything)

How can accept the download, and read the contents...?

My code :

$postarr["user"] = "user";
$postarr["pw"] = "pw";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, " ");
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postarr);
$data = curl_exec($ch);


Re: curl and download

On 14 Sep 2006 07:27:16 -0700, wrote:

Quoted text here. Click to load it

 Does this not work?
 Have you tried turning CURLOPT_VERBOSE on to work out why?
 At a wild guess do you need CURLOPT_FOLLOWLOCATION?

Andy Hassall :: :: :: disk and FTP usage analysis tool

Re: curl and download

Andy Hassall schreef:

Quoted text here. Click to load it

I forgot to tell you I'm posting to a https website... the error I get
is the following :

Connection to API feature not allowed for this user :

cURL error number:0
cURL error:1

I suppose the problem lies in the website I post to?

Site Timeline