代碼:比索 - move_uploaded_file()以廢話
echo $tmpName;
echo "<br>". "{$uploadDir}/{$folderName}/{$fileName}";
echo'<pre>';var_dump(file_exists("{$uploadDir}/{$folderName}"));echo'</pre>';
echo'<pre>';var_dump(move_uploaded_file($tmpName, "{$uploadDir}/{$folderName}/{$fileName}"));echo'</pre>';
echo substr(sprintf('%o', fileperms("{$uploadDir}/{$folderName}")), -4); echo "<br>";
if(move_uploaded_file($tmpName, "{$uploadDir}/{$folderName}/{$fileName}")) {
$sqlup = "INSERT INTO upload_obrazky (slozka_upload_obrazky, pic_upload_obrazky) VALUES ('".$folderName."', '".$fileName."')";
mysql_query($sqlup);
++$counter;
}
輸出:
Tempname:
/tmp/phpH9a6xK
真正的文件夾&:
../files/upload/834e4315ebd644ac5bd0569af73a9cf1/akne.jpg
文件夾是否存在?
bool(true)
移動上傳的文件?? !!?!?!?!?!?!?!?!?!?!?!?!?!?!?!?!
bool(false)
CHMOD上DIR:
0777
誰能告訴我,爲什麼是move_uploaded_file()以FALSE?多謝你們。
你檢查你的日誌? –
你知道你不必在你的變量周圍使用大括號('{}')。 – Mike
'var_dump(file_exists($ tmpName));'output? – Mike