我在使用图片上传脚本时遇到了问题。
我知道有很多类似的问题,但是我还没有找到适合我的解决方法。
$upload_dir = "images/postcards/";
chmod($upload_dir, 777);
if (is_writable($upload_dir)) {
echo 'The file is writable';
} else {
echo 'The file is not writable';
}
这总是返回文件“不可写”
我尝试将 chmod
设置为 0777
和 -rwxrwxrwx
。但结果始终相同。有什么想法吗?
777
是不正确的。你应该始终在前面加上0
,请查看这里 chmod。 - Madan Sapkota