我已经设置在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