[英]How to set the maxAllowedContentLength to 500MB while running on IIS7?
[英]How to change the maxAllowedContentLength of IIS 7.0?
我有一個類似的問題: 在IIS7上運行時如何將maxAllowedContentLength設置為500MB?
區別在於我已經修改了web.config
來接受最大2 Gb的文件,但是當嘗試上傳大文件時,出現以下錯誤:
請求過濾模塊被配置為拒絕超過內容長度的請求。
我的web.config
是這樣的:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<httpRuntime executionTimeout="999999" maxRequestLength="2097151"/>
<customErrors mode="Off"/>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />
<membership>
<providers>
<clear/>
</providers>
</membership>
<profile>
<providers>
<clear/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
</providers>
</roleManager>
</system.web>
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2097151" />
</requestFiltering>
</security>
</system.webServer>
嘗試上傳僅131 MB
的文件時,我仍然收到錯誤消息。
因此,我應該在maxAllowedContentLength
設置中設置什么以允許人們上傳超過100 MB的文件?
MaxRequestLength
是千字節數,而maxAllowedContentLength
是字節數 。 再次將其乘以1024,它應該可以正常工作。
maxAllowedContentLength
可選的uint屬性。
指定請求中內容的最大長度,以字節為單位。
默認值為30000000。
http://msdn.microsoft.com/zh-cn/library/ms689462(v=vs.90).aspx
在Windows Run(WinKey + r)中鍵入inetmgr ,在左側面板上單擊服務器名稱,然后在IIS部分的右側面板中,雙擊“請求篩選”。 在最右側的面板上,單擊“ 編輯功能設置...” 。 在“ 請求限制”部分中,您可以更改maxAllowedContentLength 。
如果你想只是在你的網站的一個變化maxAllowedContentLength,左側面板中選擇您的站點下站點和同路如上去改變它。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.