我已经在 C# 文件中设置了文件限制,以便它检查文件大小
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) 我需要做哪些修改?