国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
設置IIS7文件上傳的最大大小 maxAllowedContentLength,maxRequestLength

當上傳一個超過30M的文件時,服務器會重定向至404.13頁面,報錯如下:

HTTP Error 404.13 - Not Found

The request filtering module is configured to deny a request that exceeds the request content length.

這是由于服務器限制了所能上傳文件的最大值。其值在configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength setting in the applicationhost.config or web.config file. 中定義。

查看C:\Windows\System32\inetsrv\config目錄下的applicationhost.config,可以在system.webServer/security/requestFiltering/中找到requestLimits設置項,若沒有,則可以自行添加如下:(這里maxAllowedContentLength的單位為bytes。)

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

也可以使用命令行模式修改applicationhost.config為:

%windir%\system32\inetsrv\appcmd set config -section:requestFiltering -requestLimits.maxAllowedContentLength:40000000

經(jīng)過這個設置后,服務器對上傳文件的大小限制將變?yōu)?0000000bytes了。當然,這個設置是服務器級別的,如果你想在某個站點或者某個應用上限制大小,也可以通過以相同方式進行設置,只不過這次設置的是站點內(nèi)的Web.config。

但是你要進行此項修改,要確保applicationhost.config中對該項修改的權(quán)限已經(jīng)放開??赏ㄟ^如下設置進行更改:

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

<sectionGroup name="system.webServer">
     <section name="requestFiltering" overrideModeDefault="Allow" />
</sectionGroup>

確認修改過applicationhost.config中上述設置以后,再進行如下設置。

找到應用的Web.config,按上述進行修改:

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

或者你也可以通過命令行的形式:

%windir%\system32\inetsrv\appcmd set config "Default Web Site/<your app>" -section:requestFiltering -requestLimits.maxAllowedContentLength:40000000

這樣,你就能針對某個站點的某個應用進行設置。

 

但是開發(fā)人員是在Web.Config中進行了如下設置:

<system.web>

<httpRuntime maxRequestLength="40960" appRequestQueueLimit="100" useFullyQualifiedRedirectUrl="true" executionTimeout="120" />

</system.web>

這里的maxRequestLength據(jù)MSDN介紹:Gets or sets the maximum request size. The maximum request size in kilobytes. The default size is 4096 KB (4 MB).

The MaxRequestLength property specifies the limit for the buffering threshold of the input stream. For example, this limit can be used to prevent denial of service attacks(拒絕服務攻擊) that are caused by users who post large files to the server. 

The value assigned to this property should be greater or equal to value assigned to the RequestLengthDiskThreshold property.

但是開發(fā)人員的這個設置好像是不起作用的。他們在這里,限制最大請求長度為40MB,超時為120s。

下次再看一下具體這個設置是用來做什么的。

-------------------------

現(xiàn)在明白了。這個是用來設置單個請求的最大長度。比如EmailTicket中若設置maxRequestLength為30M,maxAllowedContentLength為40M,

然后在Reply Email時,選擇了一個35M的附件,在點擊Save as Draft的時候,這個請求的長度大概會有35M,這個已經(jīng)超過了maxRequestLength。此時請求就會報錯了,結(jié)果是黃頁:

Server Error in '/emailticket' Application. 

Maximum request length exceeded.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Maximum request length exceeded.

所以,最好是maxRequestLength和maxAllowedContentLength設置為一致的值。

本站僅提供存儲服務,所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
使用swfupload上傳超過30M文件,配置項
設置文件上傳的最大大小
使用IIS7.0的asp上傳大文件時出現(xiàn)如下錯誤:
Web.config在滲透中的作用
為 Outlook Web App 配置最大郵件大小
如何禁用不需要的HTTP方法
更多類似文章 >>
生活服務
分享 收藏 導長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服