Re: Copy image from a website to another?
| From: | Chris Hewitt | Date: | Mon, 15 Apr 2002 21:20:15 +0000 |
| Subject: | Re: Copy image from a website to another? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-93088@lists.php.net to get a copy of this message | ||
Carlos,
I may misunderstand you but surely the easiest way to copy a file from one computer to another is by ftp? Log into a shell on computer 1, ftp to computer 2 and transfer whatever files you want. This may be by a simple script and does not need php (did I say that?).
On the other hand, php has ftp functions you can use to do it with php (assuming you compiled php with ftp).
HTH
Regards
Chris
Lic. Carlos A. Triana Torres wrote:
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>