如何将我的图像上传到另一台与我的计算机共享文件夹Images的计算机上


how to upload my image to another computer that shared a folder Images with my computer

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

//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]: C:'xampp'htdocs'2new'ClassImage.php第66行中没有这样的文件或目录

警告:move_uploaded_file(//92.62.178.149/Documents/Images/d8426230-5a36-11e2-b0bc-616263646566.jpeg) [function. txt]在C:'xampp'htdocs'2new'ClassImage.php第68行

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

试试这个

$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.
相关文章: