600字范文,内容丰富有趣,生活中的好帮手!
600字范文 > Ueditor上传图片文件大小上限问题

Ueditor上传图片文件大小上限问题

时间:2020-10-06 22:43:05

相关推荐

Ueditor上传图片文件大小上限问题

修改IIS

IIS 之 通过 Web.config 修改文件上传大小限制设置方法

在IIS 6.0中,不设置默认大小为4M,设置文件上传大小的方法,maxRequestLength(KB),executionTimeout(毫秒),配置如下节点:

<system.web><httpRuntime maxRequestLength="102400" executionTimeout="300000"/> </system.web>

在IIS7中,设置如上设置后,不管设置多大数值,最大上传了限制为30M,还要进行如下设置才能正确:

方法1:

appcmd set config "My Site/MyApp" -section:requestFiltering -requestLimits.maxAllowedContentLength:104857600 -commitpath:apphost

在IIS服务器的命令行执行如上命令,注意修改上面的网站名称和上传文件大小

方法2:

在web.config中加入如下配置:

<system.webServer><security><requestFiltering><requestLimits maxAllowedContentLength="1048576000"></requestLimits></requestFiltering></security></system.webServer>

设置文件上传的最大大小

需要在配置文件里面设置文件上传限定的两个属性值:maxAllowedContentLength,maxRequestLength 允许上传文件的长度,和请求的长度,两个大小需要设置一致,如果不一致,则以请求长度为准。

The maximum request size in kilobytes. The default size is 4096 KB (4 MB). 默认请求长度只有4M. 设置的单位都为byte

<system.web>

<httpRuntimemaxRequestLength="2147483647" executionTimeout="36000" delayNotificationTimeout="36000"/>

</system.web>

<system.webServer>

<security>

<requestFiltering>

<!--<requestLimitsmaxAllowedContentLength="1073741824"/>-->

<requestLimits maxAllowedContentLength="2147483648"/>

</requestFiltering>

</security>

</system.webServer>

以上是对某个站点或者某个应用上限制大小,配置的web.config

要以上配置有效的前提是,要确保applicationhost.config中对该项修改的权限已经放开。

applicationhost.config文件路径在C:\Windows\System32\inetsrv\config 下

可通过如下设置进行更改:

modify the overrideModeDefault from "Deny" to "Allow" like so:

<sectionGroup name="system.webServer">

<sectionGroup name="security">

<section name="requestFiltering" overrideModeDefault="Allow" />

</sectionGroup>

</sectionGroup>

确认修改过applicationhost.config中上述设置以后,再进行web.config中的设置。

问题:IIS的最大内容长度和最大请求实体主体限制的区别???

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。