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

curl-and-php

Re: Copying image file from https-URL

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 13 Feb 2003 19:15:40 +0100 (CET)

On Tue, 11 Feb 2003, Patrick Kuebler wrote:

> I have a URL like https://www.myhost.com/servlet/return?id=1234 which
> provides me a reference to an image file. Now I want to copy this file with
> PHP on my server. The copy() and fopen() functions donīt work in the PHP
> version that I run (4.2.3) because of the https. So I hoped I can do this
> with CURL, but I donīt know how. The example showed on php.net doesnīt
> really work, the fopen() functions alway throws errors.

First, get the HTML that "reference" the image.

Then, figure out the full URL to the image and use the curl functions to
download it.

One of the PHP examples should tell you how to download the image
succesfully:

        http://curl.haxx.se/libcurl/php/examples/

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.NET email is sponsored by: FREE  SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your  SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
Received on 2003-02-13