每当我尝试移动它不工作,并显示“图像文件没有上传” ......我只是想知道哪里出错文件...为什么move_uploaded_file不起作用?
$target = '/var/www/student/public/myimage.jpg';
$destination = '/var/www/student/public/images/myimage.jpg';
if(move_uploaded_file($target, $destination)) {
echo "Image file is successfully loaded";
} else {
echo "Image file not uploaded.";
}
- 我已检查错误日志(
tail -f /var/log/apache2/error.log
),但什么也没找到。 - 目标和目的地两个目录都有权限。
有人可以告诉我如何找出错误。任何想法 ?
什么是您正在使用的* actual *代码?您提供的代码显然不起作用,因为* target *必须已经*通过PHP的HTTP POST上传机制上传*。 – animuson
为什么这个标记为zend框架?而你使用的功能是错误的。阅读它的PHP文档(http://php.net/move_uploaded_file)。 – Corbin
文件已被其他脚本上传,我将此文件移动到服务器中的其他文件夹中... – Student