如何提高ASP.NET中的最大上传文件的大​​小? [英] How to increase the max upload file size in ASP.NET?

查看:176
本文介绍了如何提高ASP.NET中的最大上传文件的大​​小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有节选的文件上传在ASP.NET表单。我需要增加最大上传大小上述4 MB的默认值。

I have a form that excepts a file upload in ASP.NET. I need to increase the max upload size to above the 4 MB default.

我发现在某些地方引用了以下code在<一个href="http://msdn.microsoft.com/en-us/library/system.web.configuration.httpruntimesection.maxrequestlength.aspx">msdn.

I have found in certain places referencing the below code at msdn.

[ConfigurationPropertyAttribute("maxRequestLength", DefaultValue = )]

无参考文献的实际描述如何使用它,我已经试过几件事情没有成功。我只希望修改此属性为所要求的文件上传某些页面。

None of the references actually describe how to use it, and I have tried several things with no success. I only want to modify this attribute for certain pages that are asking for file upload.

这是正确的路线走?我如何使用它?

Is this the correct route to take? And how do I use this?

推荐答案

本设置进去你的web.config文件。它会影响整个应用程序,虽然...我不认为你可以为每个页面设置。

This setting goes in your web.config file. It affects the entire application, though... I don't think you can set it per page.

<configuration>
  <system.web>
    <httpRuntime maxRequestLength="xxx" />
  </system.web>
</configuration>

XXX是KB。默认值是4096(= 4 MB)。

"xxx" is in KB. The default is 4096 (= 4 MB).

这篇关于如何提高ASP.NET中的最大上传文件的大​​小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆