-
Php Image Download on Server function
<?php
function downimage($image_url, $image_name, $image_path){
$image_name = $this->pretty_string($image_name);
$image_file = $image_name . '.jpg';
if( ! file_exists($image_path . $image_file) ){
$ch = @curl_init($image_url);
$fp = @fopen('../'.$image_path .'/'. $image_file, 'w+');
@curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
@curl_setopt($ch, CURLOPT_REFERER, $image_url);
@curl_setopt($ch, CURLOPT_HEADER,0);
@curl_setopt($ch, CURLOPT_FILE, $fp);
@curl_exec($ch);
@curl_close($ch);
@fclose($fp);
}
}
?>
-
-
-
Very usefull.Hope to see more releases.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks