即使upload_max_size大于文件大小,$ _ FILE上载大文件也会给出错误1 [英] $_FILE upload large file gives error 1 even though upload_max_size is bigger than the file size

查看:85
本文介绍了即使upload_max_size大于文件大小,$ _ FILE上载大文件也会给出错误1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的上传表单,其中有:

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_filesizepost_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.

这篇关于即使upload_max_size大于文件大小,$ _ FILE上载大文件也会给出错误1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆