如何在PHP中调试move_uploaded_file() [英] How to debug move_uploaded_file() in PHP
本文介绍了如何在PHP中调试move_uploaded_file()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
move_uploaded_file()不再对我有用,它工作正常,只是突然消失了.我有办法检查为什么它不再起作用了吗?这是我目前拥有的,但是它只会返回TRUE或FALSE.
move_uploaded_file() won't work for me anymore, it was working fine and just stopped out of nowhere. Is there a way for me to check why it's not working anymore? Here's what I currently have, but it only returns TRUE or FALSE.
$status = move_uploaded_file($tempFile, $targetFile);
if($status) {
echo 'its good';
} else {
echo 'it failed';
}
我知道路径是100%正确,目录是CHMOD755.我可能做错了什么吗?
I know the path is 100% correct and the directory is CHMOD 755. Is there anything I might be doing wrong?
推荐答案
也许可行:
if(!move_uploaded_file($_FILES['attachement']['tmp_name'], $uploadfile)) {
echo 'Your file was not uploaded please try again
here are your debug informations:
'.print_r($_FILES);
} else {
echo 'image succesfully uploaded!';
}
这篇关于如何在PHP中调试move_uploaded_file()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文