我有用於在服務器上上傳文件的代碼。但是我得到了由else語句產生的自定義錯誤,但我需要知道爲什麼php無法上傳文件的真正原因。 我得到錯誤2,但我沒有得到實際的消息。 有什麼建議嗎?使用php上傳文件時出現Apear錯誤
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path."/")) {
echo "The file ". basename($_FILES['uploadedfile']['name']). " has been uploaded";
} else{
echo "There was an error uploading the file, please try again! ".$_FILES['uploadedfile']['error'];
}
打開的error_reporting。 'error_reporting(E_ALL);'並查看你的日誌。或者打開'display_errors'進行開發。 'ini_set('display_errors',1);' – 2012-02-26 13:51:05
上傳的文件超出了HTML表單中指定的MAX_FILE_SIZE指令。 Thanx – themis 2012-02-26 13:53:48
$ _FILES ['uploadedfile'] ['error']報告的錯誤代碼是什麼? – 2012-02-26 13:54:53