0
我檢查過file_exists
不支持特殊字符。file_exists不能處理具有空間字符的文件名
我的系統需要檢查用戶提交的文件。並且一個文件名已包含短劃線字符,它使Internal Error 500
。 而用戶堅持不改變文件名與系統配合使用。
這裏是PHP代碼:
$file_location = $db->user_file_path; // path: /path/to/user/file/file-name.pdf
if(!file_exists($file_location))
{
// send email to user
}
我如何處理這種情況?
可能重複http://stackoverflow.com/questions/2685718/special-characters-in-file-exists-problem-php – Thamilan
我都試過了,但對我來說 –
不行什麼是「空間字符」 ?老實說,短跑並不是那麼特別。也許在ASCII範圍之外的連字符可能需要你正確編碼文件,但沒有一個解釋了發生了什麼。 –