从一个网站复制图像到我的


Copying image from one website to mine?

我想做一个网站,你在那里提交一个外部图像列表,并收到一个zip与所有的图像在它。

我知道如何用PHP制作zip文件,但我不知道如何将外部文件保存到我的服务器。我会搜索,但我不知道如何表达这样的问题

在高层…

$externalFile = 'http://example.com/image.jpg';
file_put_contents(basename($externalFile), file_get_contents($externalFile));
当然,您需要处理错误并确保url 图像(使用GD或类似的方法)。