Fetching and storing remote image


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $image = drupal_http_request($link);
  2.  
  3. $path_array = explode('/', $link);
  4. $filename = end($path_array);
  5.  
  6. $save_to = file_directory_path().'/_images/'.$filename;
  7. $temp = '/opt/httpd/htdocs/devphp.caribbeantravelmag.com/files/blog/'.$filename;
  8.  

URL: http://stackoverflow.com/questions/724391/save-image-from-php-url-using-php

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.