MVC3的Windows INPUT TYPE ="文件"大小限制 [英] MVC3 Windows input type="file" size limit
本文介绍了MVC3的Windows INPUT TYPE ="文件"大小限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个MVC3 C#.NET Web应用程序。在我的HTML视图中,我使用的是标准的Windows文件输入
I have an MVC3 C#.Net web app. In my HTML View, I am using the standard Windows file input
<input style="border:thin solid #ccc;width:270px; background-color: #FFFFFF;" type="file" name="Name" id="Name"/>
它的工作,除了大文件的罚款。我可以上传2MB的文件位不是一个4MB的文件。是否有此输入类型最大文件大小或者我可以以某种方式设置MAXSIZE?
It's working fine except for big files. I can upload a 2mb file bit not a 4mb file. Is there a max file size for this input type or can I set the maxsize somehow?
推荐答案
试着改变的maxRequestLength
在你的web.config。
Try changing the maxRequestLength
in your web.config.
<system.web>
<httpRuntime maxRequestLength="4096" />
</system.web>
该值以KB为单位。 4096实际上是默认值,你的文件可能会稍大一些,所以也许尝试一个较大的数字。
The value is in kilobytes. 4096 is actually the default value, your file might be slightly larger so maybe try a higher number.
这篇关于MVC3的Windows INPUT TYPE =&QUOT;文件&QUOT;大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文