PHP move_uploaded_file()错误? [英] PHP move_uploaded_file() error?
本文介绍了PHP move_uploaded_file()错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用以下代码,并且正在我的本地机器上成功上传文件。它在我的本地机器上显示已成功上传。
I using following code and it is successfully uploading files on my local machine. It is showing "Successfully uploaded" on my local machine.
// Upload file
$moved = move_uploaded_file($_FILES["file"]["tmp_name"], "images/" . "myFile.txt" );
if( $moved ) {
echo "Successfully uploaded";
} else {
echo "Not uploaded";
}
但是当我在我的在线服务器上使用这段代码时,它不会上传文件并且只显示消息未上传。
But when I used this code on my online server then it is not uploading file and just showing message "Not uploaded".
我如何知道问题是什么,如何才能将实际问题显示给用户?
How can I know that what is the problem and how can I get the actual problem to display to the user ?
推荐答案
检查Web服务器是否有权写入images /目录
Check that the web server has permissions to write to the "images/" directory
这篇关于PHP move_uploaded_file()错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文