2010-11-29 7 views

Répondre

1

Voir ici:

http://www.edmondscommerce.co.uk/php/php-save-images-using-curl/

function save_image($img,$fullpath){ 
$ch = curl_init ($img); 
curl_setopt($ch, CURLOPT_HEADER, 0); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_BINARYTRANSFER,1); 
$rawdata=curl_exec($ch); 
curl_close ($ch); 
if(file_exists($fullpath)){ 
    unlink($fullpath); 
} 
$fp = fopen($fullpath,'x'); 
fwrite($fp, $rawdata); 
fclose($fp); 
} 

Autres articles/sources:

http://forums.digitalpoint.com/showthread.php?t=371632

http://www.bitrepository.com/download-image.html

http://php.bigresource.com/Track/php-Jjg3DsKY/

0

de php.net - se lit également dans une chaîne.

<?php 
     // create curl resource 
     $ch = curl_init(); 

     // set url 
     curl_setopt($ch, CURLOPT_URL, "example.com"); 

     //return the transfer as a string 
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 

     // $output contains the output string 
     $output = curl_exec($ch); 

     // close curl resource to free up system resources 
     curl_close($ch);  
?> 
Questions connexes