1

我想将我的图像上传到与我的计算机共享文件夹图像的另一台计算机。这是图像的路径:

//92.62.178.149/Documents/Images

这是我的代码:

chmod ("//92.62.178.149/Documents/Images/", 0777);
move_uploaded_file($tmpname, "//92.62.178.149/Documents/Images/" . $str . "." . $type);

但我收到了一些警告:

警告:chmod() [function.chmod]:第 66 行的 C:\xampp\htdocs\2new\ClassImage.php 中没有这样的文件或目录

警告:move_uploaded_file(//92.62.178.149/Documents/Images/d8426230-5a36-11e2-b0bc-616263646566.jpeg)[function.move-uploaded-file]:无法打开流:C:\xampp\htdocs 中的权限被拒绝\2new\ClassImage.php 第 68 行

警告:move_uploaded_file() [function.move-uploaded-file]:无法将 'C:\xampp\tmp\php782.tmp' 移动到 '//92.62.178.149/Documents/Images/d8426230-5a36-11e2-b0bc-第 68 行 C:\xampp\htdocs\2new\ClassImage.php 中的 616263646566.jpeg'

4

1 回答 1

1

尝试这个

$destinationFolder = "\\\\92.62.178.149\\Documents\\Images\\";
chmod ($destinationFolder , 0777);
move_uploaded_file($tmpname, $destinationFolder  . $str . "." . $type);

笔记:-

When you are running a PHP script from the browser, you are not running it under your 
user account. You are running under whatever the HTTP server uses as the user name. 
So even if you have access to the folder, the server may not. 
The easiest fix is to give the serverwrite permission to that folder.
于 2013-01-09T08:47:19.620 回答