PHP:错误`打开流失败:没有这样的文件或目录`
我是PHP新手,我想为图片制作一个上传程序。这是我的全部代码:PHP:错误`打开流失败:没有这样的文件或目录`,php,Php,我是PHP新手,我想为图片制作一个上传程序。这是我的全部代码: <?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
<?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
........
........
?>
我读了一些关于这方面的文章,但它不起作用。任何窒息都会对我有帮助。提前谢谢太尴尬了,我忘了在“home/…”前面的
/
,问题解决了
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