hi,
how can i save a image from an other (foreign) server (accassable form a browser) - e.g. http://www.example.com/images77.gif with php ?
thanx
gruber99
save images from server
Moderator: General Moderators
If you tend to use this legally, here you go.
Use it at your own risk! Don't download any copyrighted images.
Code: Select all
<?php
// *** Image to retrieve.
$image = 'http://www.example.com/images77.gif';
$new_file_name = 'image.gif';
// *** Retrieve image contents.
$src = file_get_contents($image);
##### Create new file #####################################
$Fconn = fopen($new_file_name, 'w');
fwrite($Fconn, $src);
fclose($Fconn);
###########################################################
?>