我正在尝试使用以下代码从远程服务器复制图像:
$src = "http://www.imagelocation.com/image.jpg";
$dest = "/server/location/upload/";
file_put_contents($dest, file_get_contents($src));
Run Code Online (Sandbox Code Playgroud)
不幸的是我一直收到以下错误:
警告:file_put_contents(/ server/location/upload /)[function.file-put-contents]:无法打开流:第220行/server/location/myscript.php中的目录
你有什么想法如何解决这个问题?