$_FILE upload large file gives error 1 even though upload_max_size is bigger than the file size($_FILE 上传大文件会出现错误 1,即使 upload_max_size 大于文件大小)
问题描述
我有一个简单的上传表单:
I have a simple upload form with:
enctype="multipart/form-data"/>
和
input type="hidden" name="MAX_FILE_SIZE" value="5900000" />
在 php.ini 中应用以下设置(通过 phpini() 检查):
And the following settings, that are applied (checked through phpini()) in php.ini:
upload_max_filesize = 7MB
memory_limit = 64M
post_max_size = 8MB
我尝试上传一个很小的文件 - 500k 并且它通过了
I try to upload a file that is small - 500k and it goes through
我尝试上传一个 5MB 的文件(小于 upload_max_filesize
和 post_max_size
设置),但它失败并显示错误代码 1:它说的是:
I try to upload a file that is 5MB (smaller than both upload_max_filesize
and post_max_size
settings) and it fails with error code 1: which says is:
UPLOAD_ERR_INI_SIZE值:1;上传的文件超过了 php.ini 中的 upload_max_filesize 指令.
UPLOAD_ERR_INI_SIZE Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.
有人知道发生了什么吗?
Anyone has a clue what is going on?
推荐答案
我认为这是因为一个错字.而不是
I think this is because of a typo. Instead of
upload_max_filesize = 7MB
它应该是
upload_max_filesize = 7M
再次使用 phpinfo()
来检查实际应用了什么值.
use phpinfo()
again to check what value actually gets applied.
这篇关于$_FILE 上传大文件会出现错误 1,即使 upload_max_size 大于文件大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:$_FILE 上传大文件会出现错误 1,即使 upload_max_size 大于文件大小


基础教程推荐
- 超薄框架REST服务两次获得输出 2022-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 在多维数组中查找最大值 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01