完整的错误信息:
PHP Warning: move_uploaded_file(): Unable to move '/tmp/phpVZ330Q' to 'uploads/dining.jpg' in /var/www/website.mediaclash.co.uk/siteroot/nomination-form.php on line 33, referer: http://website.co.uk/nominations.php
大家好,
我正在尝试向服务器发送一个表单,该服务器将数据发送到一个电子邮件地址。但是我在文件上传时遇到问题。当我尝试上传文件时出现上述错误。我已将站点目录的所有权限更改为 775,但没有更改。似乎它正在获取正确的目标路径并发布文件名。
这对我来说是新的,所以任何帮助将不胜感激。
这是我的PHP:
//文件要上传到哪里 $target_path = "uploads/";
//Add the original file name to our target path
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)){
echo "The file" . basename($_FILES['uploadedfile']['name']).
"has been uploaded";
}else{
echo "There was an error uploading the file, please try agaian.";
}
<input type="hidden" name="MAX_FILE_SIZE" value="5120000" />
<input name="uploadedfile" type="file" />
我希望这是足够的信息。如果您需要我提供更多信息,请告诉我。
谢谢!