View Single Post
Old 06-22-2009, 09:57 AM   #2 (permalink)
Wildhoney
La Vida es Sueño
Advanced Programmer Top Contributor 
 
Wildhoney's Avatar
 
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
Wildhoney is on a distinguished road
Default

There are a few cURL options when accessing a HTTPS resource, but the one I used in my script when I wrote one, was the following:

php Code:
$szUrl  = 'https://www.example.com/';
$pCurl  = curl_init();

curl_setopt($pCurl, CURLOPT_URL, $szUrl);
curl_setopt($pCurl, CURLOPT_USERPWD, 'username:pasword');
curl_setopt($pCurl, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
curl_setopt($pCurl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($pCurl, CURLOPT_RETURNTRANSFER, true);

$szData = curl_exec($pCurl);
curl_close($pCurl);

As far as downloading the file is concerned, once you have the download link then all you have to do is make a call to it, either with cURL, or file_get_contents. Treat it just as though you're fetching web-page data.
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
Send a message via AIM to Wildhoney Send a message via MSN to Wildhoney Send a message via Yahoo to Wildhoney
Wildhoney is offline  
Reply With Quote