文件上传处理错误信息说明

2024-07-17 23:48 更新

为了获取更多最新内容及功能更新,请直接访问我们的首页以查看DzzOffice笔记的最新地址。

UPLOAD_ERR_OK

Value: 0; There is no error, the file uploaded with success.其值为 0,没有错误发生,文件上传成功。

UPLOAD_ERR_INI_SIZE

Value: 1; The uploaded file exceeds the

upload_max_filesize

directive in

php.ini

.其值为 1,上传的文件超过了php.ini中

upload_max_filesize

选项限制的值。

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

选项指定的值。

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环境中的PHP设置不正确造成的。其中一项设置要求Dzzoffice将上传的文件存储在临时文件夹中,然后再将它们保存到所需位置。如果无法访问该临时文件夹,Dzzoffice将无法处理您上传的文件和软件更新。无论您是否意外删除了临时文件夹,当Dzzoffice无法找到或访问该文件夹时,都会发生此错误。

修复“缺少临时文件夹”错误

您需要检查

php.ini

中的一些内容。确保您点击了正确的

php.ini

:

  • upload_tmp_dir:这是 PHP 上传时存储临时文件的目录。
  • open_basedir:限制PHP对指定路径及其子目录的读写权限操作。 确保 upload_tmp_dir 在此路径内!
  • post_max_size:调大以适应您上传的尺寸。
  • upload_max_filesize:允许的文件大小限制。
还有种可能就是临时文件夹的权限不够。

具体要怎么处理要您自行根据所使用的环境来解决,百度一下,你就知道。

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扩展阻止了文件上传。PHP没有提供一种方法来确定哪个扩展名导致文件上传停止;使用

phpinfo()

检查加载的扩展列表可能会有所帮助。

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超过最大文件数

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调整图像大小失败


以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号