錯誤提示:
HTTP Error 404.15 - Not Found
The request filtering module is configured to deny a request where the query string is too long.
原因:
IE的get請求url默認是2k(各個瀏覽器或許不一樣,但是get請求是有長度限制的)
解決:
1.修改配置項
<system.webServer>
<security>
<requestFiltering >
<requestLimits maxAllowedContentLength="4096" ></requestLimits>
</requestFiltering>
</security>
</system.webServer>
2.采用post方式,無長度限制並且更加安全
注:
Microsoft Internet Explorer (Browser)
IE瀏覽器對URL的最大限制為2083個字符,如果超過這個數字,提交按鈕沒有任何反應。在我的測試中,這個數字得到驗證。
Firefox (Browser)
對於Firefox瀏覽器URL的長度限制為65,536個字符,但當我測試時,最大只能處理8182個字符,這是因為url的長度除了瀏覽器限制外,還會受Web服務器的限制,而我本機使用的是ubuntu apache服務器,最大處理能力為8192個字符(相差10個字符,不知道是什么原因),一旦超過這個長度,服務器就返回如下錯誤信息。
Safari (Browser)
URL最大長度限制為 80,000個字符。
Opera (Browser)
URL最大長度限制為190,000個字符。
Google (chrome)
url長度一旦超過8182個字符時,出現如下服務器錯誤:
Apache (Server)
能接受最大url長度為8,192個字符,但我的測試數據是8,182,10個字符,差別不在,數據具體符合。
Microsoft Internet Information Server(IIS)
能接受最大url的長度為16,384個字符。
寫道
Request-URI Too Large
The requested URL's length exceeds the capacity limit for this server.
Apache/2.2.12 (Ubuntu) Server at 127.0.1.1 Port 80