由ASP.NET文件上传控件允许的最大文件大小 [英] Maximum file size allowed by ASP.NET file upload Control

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

问题描述

我正在使用ASP.Net文件上传控制,遵循下面的博客的方法。

I am using File upload control in ASP.Net, followed the below blogs approach.

<一个href=\"http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx\">http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx

4MB的默认设置是在machine.config中,但你可以在你的web.config覆盖它。例如,为了扩大上传限制为20MB,你应该这样做:

The 4MB default is set in machine.config, but you can override it in you web.config. For instance, to expand the upload limit to 20MB, you'd do this:

<system.web>
  <httpRuntime executionTimeout="240" maxRequestLength="20480" />
</system.web>

问:
 直到什么水平(MAX大小)我可以增加请求的长度,什么将会对网站性能的影响,如果我们允许用户同时上传50-60 MB的文件。

Question: Till what level(MAX size) i can increase the requested length and what will be performance impact on site if we allowed user to upload 50-60 MB files also.

推荐答案

的maxRequestLength 字段中的'理论'最高等级是32位有符号整数的最大值数据类型( Int32.MaxValue )。

The 'theoretical' max level for the maxRequestLength field is the max value for signed 32-bit integer data type (Int32.MaxValue).

不过,你将要测试的上传,以了解你的表现。

However, you are going to have to test the upload in order to understand your performance.

编辑:

微软支持票:

理论上,最大文件上载大小是相当大的。然而,
  因为ASP.NET健康监测,你不能上传非常大
  文件ASP.NET。 ASP.NET工作进程有一个虚拟地址
  2千兆字节(GB)的空间。但是,ASP.NET工作过程只
  使用稍多于1 GB由于运行状况监视和内存
  碎片。

Theoretically, the maximum file upload size is fairly large. However, because of ASP.NET health monitoring, you cannot upload very large files in ASP.NET. The ASP.NET worker process has a virtual address space of 2 gigabytes (GB). However, the ASP.NET worker process only uses a little more than 1 GB because of health monitoring and memory fragmentation.

在上载过程中,ASP.NET加载到内存整个文件
  然后用户才可以将文件保存到磁盘。因此,处理
  可以回收,因为中processModel的memoryLimit属性的
  标签Machine.config文件。 memoryLimit属性指定
  物理内存的百分比ASP.NET辅助进程可以
  这个过程之前,在自动回收。回收
  而导致ASP.NET崩溃或停止prevents内存泄漏
  响应。

During the upload process, ASP.NET loads the whole file in memory before the user can save the file to the disk. Therefore, the process may recycle because of the memoryLimit attribute of the processModel tag in the Machine.config file. The memoryLimit attribute specifies the percentage of physical memory that the ASP.NET worker process can exhaust before the process is automatically recycled. Recycling prevents memory leaks from causing ASP.NET to crash or to stop responding.

此外,其他因素在最大文件大小角色
  可上传。这些因素包括,可用可用内存
  硬盘空间,处理器速度,以及当前的网络流量。同
  正在上传文件的正常交通,Microsoft建议您
  在10至20兆字节(MB)的范围使用的最大文件大小。如果
  你很少上载文件,最大文件大小可以为100 MB。

Additionally, other factors play a role in the maximum file size that can be uploaded. These factors include available memory, available hard disk space, processor speed, and current network traffic. With regular traffic of files being uploaded, Microsoft recommends that you use a maximum file size in the range of 10 to 20 megabytes (MB). If you rarely upload files, the maximum file size may be 100 MB.

请注意,您可以上载在ASP.NET大于100 MB的文件。
  但是,Microsoft建议您遵循最大文件上载
  在这篇文章中提到的尺寸。要确定更precise
  文件大小,是类似于计算机上执行压力测试
  将在生产中使用的那些。

Note You can upload files that are larger than 100 MB in ASP.NET. However, Microsoft recommends that you follow the maximum file upload sizes that are mentioned in this article. To determine more precise file sizes, perform stress testing on computers that are similar to the ones that will be used in production.

这篇关于由ASP.NET文件上传控件允许的最大文件大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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