开发者

How to copy an external image to local?

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜