[英]enlarge uploaded file size in webconfig using asp.net
My case is when I am uploading file with size more than 4mb i want to display a friendly message to the user but when i accross this limit it dose not give me an error instead it takes me to : 我的情况是,当我上传大小超过4mb的文件时,我想向用户显示一条友好的消息,但是当我遇到此限制时,它不会给我一个错误,而是将我带到了:
Internet Explorer cannot display the webpage
what i am doing to check on file size is like that : 我正在检查文件大小的方法是这样的:
if (FU_EnglishFile.PostedFile.ContentLength > int.Parse(ConfigurationManager.AppSettings["MaxUploadSize"]))
{
lbl_InvalidFileMsg.Visible = true;
return;
}
else
{
lbl_InvalidFileMsg.Visible = false;
}
where my file size from the web config is : 我在网络配置中的文件大小是:
<add key="MaxUploadSize" value="4194304" />
is there is any configuration should i set in the web config or something any help would be a appreciated 我应该在Web配置中设置任何配置吗,还是需要任何帮助?
请使用上面的代码以减小大小,例如3MB,然后检查结果。
I found an answer to the question : 我找到了这个问题的答案:
kindly set this tag in the web config 请在网络配置中设置此标签
<system.web>
<httpRuntime executionTimeout="240" maxRequestLength="20480" />
</system.web>
thanks 谢谢
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.