AsyncFileUpload 文件大小限制 [英] AsyncFileUpload file size limit
问题描述
当我使用 AsyncFileUpload
上传 100KB 图像时,我没有收到错误消息.但图像没有上传.我可以成功上传 75KB 图像.我使用的是 IIS 6.0.
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" />
推荐答案
您可以上传合并大小最大为 2GB 的文件,但这需要对您的应用程序配置文件进行一些修改.
You can upload files with a combined size of up to 2GB, but it requires some modifications in your application configuration files.
- 将 httpRuntime 中的 maxRequestLength 设置为 1024000000(最大 2GB,您已完成此操作)
- 指定请求在被 ASP.NET 自动关闭之前允许执行的最大秒数.此设置的值在调试模式下会被忽略..NET Framework 2.0 中的默认值为 110 秒.要启用可能需要很长时间的大文件上传,请增加此属性.请参阅以下 MSDN 文章:http://msdn2.microsoft.com/en-我们/图书馆/e1f13641.aspx.
打开文件 C:WindowsSystem32inetsrvconfigapplicationHost.config 并找到以下行:
- 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:WindowsSystem32inetsrvconfigapplicationHost.config and find the line:
<section name="requestFiltering" overrideModeDefault="Deny" />
最后虽然我不经常看到它
Finally Though I don't see it very often
- 如果有任何第三方网络监控软件,您应确保其配置正确,以允许上传所需长度和内容的文件.
另外还有一个关于 stackoverflow 的问题,它进入了这个 如何配置 IIS 以处理非常大的文件上传?
Also there is another question on stackoverflow which goes into this How do I configure IIS to handle really large file uploads?
在上述问题中,答案 https://stackoverflow.com/a/206796/728841 列出了 Urlscan 作为问题是它有自己的请求实体长度限制.此人不知道 Urlscan 在服务器上运行,因为它是一个全局 ISAPI 过滤器,而不是在单个网站上运行.
In the above question the answer https://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.
注意:要找到全局 ISAPI 过滤器,请右键单击 IIS 管理中的网站文件夹,然后单击属性",然后单击ISAPI 过滤器"选项卡.
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屋!