我已經設置在C#中文件的文件的限制,以便它會檢查文件的大小文件上傳顯示404錯誤
int filesize = personalFileUpload.PostedFile.ContentLength;
if (filesize <= 26214400)
{
}
也是在我的網絡配置文件,我有以下代碼:
<httpRuntime executionTimeout="9999" maxRequestLength="2097151" requestValidationMode="2.0"/>
和
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<security>
<requestFiltering>
<requestLimits maxAllowedContentLength="104857600" />
</requestFiltering>
</security>
</system.webServer>
但是當我附上約200 MB的文件的大小仍然我得到這個錯誤:
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.
1)我的代碼是否正確? 2)我需要做些什麼修改?
你可以試試這個下<的httpRuntime的maxRequestLength = 「2147483647」 requestLengthDiskThreshold = 「2147483647」/> –
bot
2013-05-09 04:42:50
我試過,但我得到了同樣的錯誤。 – 2013-05-09 04:49:18
你在哪裏得到404錯誤?在瀏覽器中?如果是這樣,它表示它試圖加載哪個頁面。您的表單操作可能已被設置爲不存在的頁面。 – Adrian 2013-05-09 05:07:19