Possible Duplicate:
save image from php url using php
How can i use php to save/grab an image from another domain(not on my domain/server) and save it in a directory of my site.
The URL of the image for example , will be :
http://anothersite/images/goods.jpg
How can i use PHP to grab “good.jpg” ,and save it in my directory which is www.mysite.com/directory/
I hope someone could guide me.
Thanks!
You should be able to use
file_get_contentsfor this one. In order to use an URL withfile_get_contentsmake sureallow_url_fopenis enabled in youphp.inifile.Make sure that you have write permission to the directory where you want to store the image; to make the folder writable you could do this:
References