PHP:错误`无法打开流:没有这样的文件或目录`

时间:2017-07-22 11:43:31

标签: php

我是PHP的新手,我想为图像制作一个Uploader。这是我的整个代码:

<?php
include "checkConnection.php";
$fileName = $_FILES['picture']['name']; //get the file name
$fileSize = $_FILES['picture']['size']; //get the size
$fileError = $_FILES['picture']['error']; //get the error when upload
if($fileSize > 0 || $fileError == 0){ //check if the file is corrupt or error
$move = move_uploaded_file($_FILES['picture']['tmp_name'], 'home/mario/public_html/API/Content/Images/'.$fileName); //save image to the folder
........
........
?>

我在$move = move_uploaded_file($_FILES['picture']['tmp_name'], 'home/mario/public_html/API/Content/Images/'.$fileName); //save image to the folder

上收到错误
Warning: move_uploaded_file(home/mario/public_html/API/Content/Images/1492599446257.jpg): failed to open stream: No such file or directory in /home/mario/public_html/API/uploadFile.php on line 7

Warning: move_uploaded_file(): Unable to move '/tmp/phpPvn44L' to 'home/mario/public_html/API/Content/Images/1492599446257.jpg' in /home/mario/public_html/API/uploadFile.php on line 7

我读了一些关于此的文章,但它没有用。任何后果都会对我有所帮助。在此先感谢

1 个答案:

答案 0 :(得分:0)

它如此尴尬,我忘记了'home / ....前面的/它已经解决了。