Download / Display external url image

   $image = file_get_contents('http://www.xxxx.com/xxx.png');  
   $file = file_save_data($image, 'public://' . filename ,FILE_EXISTS_REPLACE); 
   $node->field_image[LANGUAGE_NONE]['0']['fid'] = $file->fid; // save image into node field
 
/***************/
$option = array('method' => 'post');
$result = drupal_http_request('http://www.xxxx.com/xxx.png', $option);
if ($result->code == 200) {
  print $result -> data; //display 
}
Help Share this Article