Copy image from a website to another?

From: Date: Mon, 15 Apr 2002 17:54:16 +0000
Subject: Copy image from a website to another?
Groups: php.general 
Request: Send a blank email to php-general+get-93053@lists.php.net to get a copy of this message
Hello all, I am learning php and I am trying to make a very simple script so as to download a jpg from one site I manage to another that I also manage. It would be, get a jpg from http://www.first_site.com/image.jpg and put in to http://www.second_site.com/image.jpg. I have tried this, but the only way it works is if I give the absolute path to the file...($file_name="/usr/local/htdocs/...image.jpg") but how can I make it work with the URL? Thanks for your suggestions... <? $file_name="http://www.first_site.com/image.jpg" if(isset($upload)){copy($file, "uploads/$dir/$file_name"); } ?> <table border="0" width="80%" cellspacing="5" cellpadding="5"> <form action="<?=$PHP_SELF;?>" method="post" enctype="multipart/form-data"> <tr> <td colspan="2"><input type="hidden" name="max_tam" value="100000"><input type="submit" name="upload" value="Upload"></td> </tr> </form> </table>

« previous php.general (#93053) next »