錯誤提示
Server Error
404 – File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is
temporarily unavailable.
原有配置:可以上傳的文件限制已經(jīng)設置相當大了500MB
<!--設置最大可上傳的文件 和超時時間-->
<system.web>
<!--512000 kb = 500mb;6時(h)=21600秒(s)-->
<httpRuntime maxRequestLength="512000" executionTimeout="21600" appRequestQueueLimit="100" />
<!--executionTimeout:表示允許執(zhí)行請求的最大時間限制,單位為秒-->
<!--maxRequestLength:指示 ASP.NET 支持的最大文件上載大小丽涩。該限制可用于防止因用戶將大量文件傳遞到該服務器而導致的拒絕服務攻擊入挣。指定的大小以 KB 為單位。默認值為 4096 KB (4 MB)。-->
<!--appRequestQueueLimit:表示ASP.NET 將為應用程序排隊的請求的最大數(shù)目抄肖。當沒有足夠的自由線程來處理請求時纵苛,將對請求進行排隊铣卡。當隊列超出了該設置中指定的限制時奢赂,將通過“503 - 服務器太忙”錯誤信息拒絕傳入的請求。-->
<compilation debug="true" />
</system.web>
<!--<system.web>
<compilation debug="true" targetFramework="4.6.1"/>
<httpRuntime targetFramework="4.6.1"/>
<httpModules>
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web"/>
</httpModules>
</system.web>-->
具體問題
IIS 的maxAllowedContent Length的缺省值為30000000 bytes. 上傳大于這個長度的數(shù)據(jù)流被截斷缎玫,導致文件或目錄找不到硬纤。
解決辦法
<system.webServer>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="2097152000" maxQueryString="5000" maxUrl="8000"></requestLimits>
</requestFiltering>
</security>
</system.webServer>