I want to retrive an http external image an copy it to a folder on my server (eg. /images/example.jpg)
Is there a way to do this with symfony 2.0开发者_高级运维 or with basic PHP 5 functions?
you can do it like this:
file_put_contents('tmp.jpg', file_get_contents('http://static.adzerk.net/Advertisers/3603.jpg'));
But, be careful, if it's a web page, it maybe very slow, depending on the speed of image page.
精彩评论