cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

RE: Download a file from an https site.

From: Fluteau Jerome ICM N PG U PLM A 2 <Jerome.Fluteau_at_icn.siemens.de>
Date: Tue, 29 Oct 2002 15:14:06 +0100

I tried curl_setopt(... CURLOPT_FILE) but there is a problem with Apache.
When I use it,
Apache sends me an Application error:

"The instruction at "0x77..." referenced memory at "0x00...". The memory
could not be "written"".

Although when I remove it, I get my file into IE as previously. But the
problem remains...:-)
The problem is that Apache doesn't allow me to write in my htdocs folder I
think.
But there is no rights working on my PC, I don't see the problem, maybe I
forgot something in httpd file...

Sorry it is surely not the right place for this Apache problem, but maybe
someone has an idea...

Regards.

-----Original Message-----
From: Daniel Stenberg [mailto:daniel_at_haxx.se]
Sent: Monday, October 28, 2002 5:33 PM
To: curl and php list
Subject: Re: Download a file from an https site.

On Thu, 24 Oct 2002, Fluteau Jerome ICM N PG U PLM A 2 wrote:

> Basically when we use IE, we click on the URL, and then Windows asks us
> where we want to store this file on our hard disk. I'd like to do the same
> thing but automaticaly in a PHP script using Curl.
>
> How can I trigger the file downloading and store it exactly where I want
on
> my disk?

1. Install the CURL module with your PHP.

2. Write your CURL-using program. A few keywords:

  curl_init("https://...")

  curl_setopt(... CURLOPT_FILE)

  curl_exec()

  curl_close()

3. Enjoy your downloaded file.

Or, if you can't install the curl module, use the curl command line tool
from
within your script.

Ah, and try the docs:

        http://www.php.net/manual/en/ref.curl.php

and for the CURLOPT_ ones, try this:

        http://curl.haxx.se/libcurl/c/curl_easy_setopt.html

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2002-10-29