使用PHP将图像文件从一个服务器移动到另一个服务器


Move an image file from one server to another using PHP

在不安装任何新东西或使用FTP将映像从一台服务器移动到另一台服务器的情况下,最好的方法是什么?你将如何做到这一点?

您可以使用phpCURL将上传到Web服务器的文件移动到其他服务器吗?你能给$_FILES分配一个文件吗?

一种简单的方法是使用file_get_contents

这是一个的例子

$path = 'image.jpg';
$file = file_get_contents("http://yoursite.com/imagepath.jpg");
file_put_contents($path,$file);
相关文章: