文件上傳處理錯誤信息說明

2024-07-17 23:48 更新

為了獲取更多最新內(nèi)容及功能更新,請直接訪問我們的首頁以查看DzzOffice筆記的最新地址。

UPLOAD_ERR_OK

Value: 0; There is no error, the file uploaded with success.其值為 0,沒有錯誤發(fā)生,文件上傳成功。

UPLOAD_ERR_INI_SIZE

Value: 1; The uploaded file exceeds the

upload_max_filesize

directive in

php.ini

.其值為 1,上傳的文件超過了php.ini中

upload_max_filesize

選項(xiàng)限制的值。

UPLOAD_ERR_FORM_SIZE

Value: 2; The uploaded file exceeds the

MAX_FILE_SIZE

directive that was specified in the HTML form.其值為 2,上傳文件的大小超過了 HTML 表單中

MAX_FILE_SIZE

選項(xiàng)指定的值。

UPLOAD_ERR_PARTIAL

Value: 3; The uploaded file was only partially uploaded.其值為 3,文件只有部分被上傳。

UPLOAD_ERR_NO_FILE

Value: 4; No file was uploaded.其值為 4,沒有文件被上傳。

UPLOAD_ERR_NO_TMP_DIR

Value: 6; Missing a temporary folder.其值為 6,找不到臨時文件夾。

解釋“缺少臨時文件夾”

缺少臨時文件夾”

錯誤是由于您的Dzzoffice環(huán)境中的PHP設(shè)置不正確造成的。其中一項(xiàng)設(shè)置要求Dzzoffice將上傳的文件存儲在臨時文件夾中,然后再將它們保存到所需位置。如果無法訪問該臨時文件夾,Dzzoffice將無法處理您上傳的文件和軟件更新。無論您是否意外刪除了臨時文件夾,當(dāng)Dzzoffice無法找到或訪問該文件夾時,都會發(fā)生此錯誤。

修復(fù)“缺少臨時文件夾”錯誤

您需要檢查

php.ini

中的一些內(nèi)容。確保您點(diǎn)擊了正確的

php.ini

:

  • upload_tmp_dir:這是 PHP 上傳時存儲臨時文件的目錄。
  • open_basedir:限制PHP對指定路徑及其子目錄的讀寫權(quán)限操作。 確保 upload_tmp_dir 在此路徑內(nèi)!
  • post_max_size:調(diào)大以適應(yīng)您上傳的尺寸。
  • upload_max_filesize:允許的文件大小限制。
還有種可能就是臨時文件夾的權(quán)限不夠。

具體要怎么處理要您自行根據(jù)所使用的環(huán)境來解決,百度一下,你就知道。

UPLOAD_ERR_CANT_WRITE

Value: 7; Failed to write file to disk.其值為 7,文件寫入失敗。

UPLOAD_ERR_EXTENSION

Value: 8; A PHP extension stopped the file upload. PHP does not provide a way to ascertain which extension caused the file upload to stop; examining the list of loaded extensions with

phpinfo()

may help.其值為 8,PHP擴(kuò)展阻止了文件上傳。PHP沒有提供一種方法來確定哪個擴(kuò)展名導(dǎo)致文件上傳停止;使用

phpinfo()

檢查加載的擴(kuò)展列表可能會有所幫助。

post_max_size

value: The uploaded file exceeds the post_max_size directive in php.ini.上傳的文件超過了php.ini中的post_max_size指令

max_file_size

value: File is too big.文件太大

min_file_size

value: File is too small文件太小

accept_file_types

value: Filetype not allowed文件類型不允許

max_number_of_files

value: Maximum number of files exceeded超過最大文件數(shù)

max_width

value: Image exceeds maximum width圖像超過最大寬度

max_height

value: Image exceeds maximum height圖像超過最大高度

min_height

value: Image requires a minimum height圖像需要一個最小高度

abort

value: File upload aborted文件上傳失敗

image_resize

value: Failed to resize image調(diào)整圖像大小失敗


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號