AsyncFileUpload文件大小限制 [英] AsyncFileUpload file size limit

查看:249
本文介绍了AsyncFileUpload文件大小限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用 AsyncFileUpload 上传100KB的形象,我没有错误消息,但图像没有上传。我可以succssfully上传75KB的形象。我使用IIS 6.0。

 < CC1:AsyncFileUpload ID =afuImgWIDTH =400像素=服务器
UploaderStyle =传统ThrobberID =Throbber2
    OnClientUploadError =uploadErrorImg
    OnClientUploadStarted =StartUploadImg
    OnClientUploadComplete =UploadCompleteImg/><的httpRuntime的maxRequestLength =1024000
executionTimeout =54000
enableHeaderChecking =FALSE/>


解决方案

您可以上传文件,高达2GB的组合大小,但它需要在你的应用程序配置文件进行一些修改。


  • 在设定的httpRuntime 的maxRequestLength 以10.24亿(最大2GB ,你这样做)

  • 指定的一个请求被允许由ASP.NET被自动关闭之前执行的最大秒数。此设置的值在调试模式下被忽略。在.NET Framework 2.0中默认为110秒。
    要启用大文件的上传,这可能需要大量时间周期,增加该属性。
    请参见下面的MSDN文章:<一href=\"http://msdn2.microsoft.com/en-us/library/e1f13641.aspx\">http://msdn2.microsoft.com/en-us/library/e1f13641.aspx.

  • 打开文件的 C:\\ WINDOWS \\ SYSTEM32 \\ INETSRV \\设置\\的applicationHost.config 的并找到行:

     &lt;节名称=的requestFilteringoverrideModeDefault =拒绝/&GT;


  • 的overrideModeDefault属性设置为允许

  • 下面的属性可以在的machine.config 的文件中的元素进行分配。他们必须在机器的水平,而不是在web.config中的应用程序级别设置。

  • responseDeadlockInterval - 指定的时间间隔,格式为HH:MM:SS,在这之后,如果没有发生过这段时间内响应的进程重新启动。默认设置为3分钟。要允许非常大的上传,您可能需要增加该值。

  • responseRestartDeadlockInterval - 指定的时间,格式为HH:MM:SS,之前重新启动的过程中再次治的僵局,必须在最后一次重启后经过治愈陷入僵局。要允许非常大的上传,您可能需要增加该值。

  • ASPMaxRequestEntityAllowed把 - 有时候,当应用程序在Windows Server 2003上承载,似乎上面的设置不具有效力。在这种情况下,必须修改IIS元数据文件,特别是ASPMaxRequestEntityAllowed把财产。欲了解更多信息,请参阅:
    <一href=\"http://www.telerik.com/support/kb/article/b454K-gth-b454T-cee.aspx\">http://www.telerik.com/support/kb/article/b454K-gth-b454T-cee.aspx

最后,虽然我没有看到它经常


  • 如果有任何第三方的网络监控软件,你应该确保它被正确配置为允许文件上传与所需的长度和内容。

另外还有计算器上的另一个问题而进入该<一个href=\"http://stackoverflow.com/questions/206132/how-do-i-configure-iis-to-handle-really-large-file-uploads\">How我做配置IIS来处理真正的大文件上传?

在上述问题的答案 http://stackoverflow.com/a/206796/728841 列出URLSCAN作为问题是有它自己的请求的实体长度的限制。的人是不知道URLSCAN在服务器上运行,因为它是一个全球性的ISAPI筛选器,个人网站没有运行。

请注意:查找全局ISAPI筛选器,右键点击IIS管理网站文件夹,然后单击属性,那么ISAPI筛选器选项卡上

When I was using AsyncFileUpload to upload 100KB image, I got no error message., but image not uploaded. I can upload 75KB image succssfully. I am using IIS 6.0.

    <cc1:AsyncFileUpload ID="afuImg" Width="400px" runat="server" 
UploaderStyle="Traditional" ThrobberID="Throbber2"  
    OnClientUploadError="uploadErrorImg" 
    OnClientUploadStarted="StartUploadImg" 
    OnClientUploadComplete="UploadCompleteImg" />

<httpRuntime maxRequestLength = "1024000" 
executionTimeout="54000" 
enableHeaderChecking ="false" />

解决方案

You can upload files with a combined size of up to 2GB, but it requires some modifications in your application configuration files.

  • set maxRequestLength in httpRuntime to 1024000000 (2GB max, you've done this)
  • Specifies the maximum number of seconds that a request is allowed to execute before being automatically shut down by ASP.NET. The value of this setting is ignored in debug mode. The default in .NET Framework 2.0 is 110seconds. To enable large file uploads, which can take large periods of time, increase this property. See the following MSDN article: http://msdn2.microsoft.com/en-us/library/e1f13641.aspx.
  • Open the file C:\Windows\System32\inetsrv\config\applicationHost.config and find the line:

    <section name="requestFiltering" overrideModeDefault="Deny" />
    

  • Set the overrideModeDefault property to Allow.
  • The following attributes can be assigned in the element of the machine.config file. They must be set at the machine level, not the application level in web.config.
  • responseDeadlockInterval - Specifies the time interval, in the format HH:MM:SS, after which the process is restarted if there has not been a response during this interval. The default is 3 minutes. To allow very large uploads, you may have to increase this value.
  • responseRestartDeadlockInterval - Specifies the time, in the format HH:MM:SS, that must elapse after the last restart to cure a deadlock before the process is restarted to cure a deadlock again. To allow very large uploads, you may have to increase this value.
  • AspMaxRequestEntityAllowed - Sometimes when the application is hosted on Windows Server 2003, the above settings do not seem to have effect. In this case you must modify the IIS metadata file, particularly the AspMaxRequestEntityAllowed property. For more info see: http://www.telerik.com/support/kb/article/b454K-gth-b454T-cee.aspx

Finally Though I don't see it very often

  • If there is any third party network monitoring software you should ensure that it is properly configured to allow file uploads with the needed length and content.

Also there is another question on stackoverflow which goes into this How do I configure IIS to handle really large file uploads?

In the above question the answer http://stackoverflow.com/a/206796/728841 lists Urlscan being the problem it has it's own request entity length limit. The person was not aware that Urlscan was running on the server because it was a global ISAPI filter, not running on the individual website.

Note: to locate global ISAPI filters, right click on the Web Sites folder in IIS Admin and click Properties, then on the ISAPI Filters tab.

这篇关于AsyncFileUpload文件大小限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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