Hi,
I'd like my website (siteA.com) to use php to download a jpeg file that resides on a different network (siteB.com). So, let's say there's an image http://siteB.com/mypicture.jpeg ..... I'd like to save it to http://siteA.com/mypicture.jpeg.
Could someone please post sample code of how to get php to do this?
Thank you in advance.
-Ralph
[man]file_get_contents[/man] Quoting from which:
Tip: You can use a URL as a filename with this function if the fopen wrappers have been enabled. See fopen() for more details on how to specify the filename....
And there are functions for saving files listed there as well. RTFM, in short.
As a side note, since I had problems with that, your host needs to allow outbound connections, especially if you are on a shared environment.