增加iis6中文件上传大小限制
除了metabase.xml文件之外还有其他地方可以修改文件上传大小吗?
我目前正在运行带有 IIS6 的临时服务器,它设置为允许上传最大 20mb 的文件。 这工作得很好。 我有一个新的生产服务器,我正在尝试设置相同的可用大小限制。 所以我编辑了metabase.xml 文件并将其设置为20971520。然后我重新启动了IIS,但这不起作用。 所以我然后重新启动了整个服务器,这也不起作用。 我可以上传大约 2mb 的文件,因此它绝对允许文件大小大于标准 200kb 默认大小。 我尝试上传 5mb 文件,但我的 upload.aspx 页面完全崩溃。 是否可能还有其他我需要配置的东西? 生产服务器位于服务器群中,是否可以对其设置一些限制?
谢谢
Is there any other place besides the metabase.xml file where the file upload size can be modified?
I am currently running a staging server with IIS6 and it is setup to allow uploading of files up to 20mb. This works perfectly fine. I have a new production server where I am trying to setup this same available size limit. So I edited the metabase.xml file and set it to 20971520. Then I restarted IIS and that didn't work. So I then restarted the entire server, that also didn't work. I can upload files around 2mb so it is definitely allowing file sizes larger then the standard 200kb default size. I try uploading a 5mb file and my upload.aspx page completely crashes. Is it possible there is something else I need to configure? The production server is located on a server farm, could there be some limits set on there end?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我将扩展对你的问题的回答,以考虑其他可能的情况。
了解如何上传大文件的一个非常好的链接是:
http://weblogs .asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx
Jon Galloway 在此解释了处理该问题的最佳技术:
1.-更改计算机配置或 web.config:
在这里您不仅可以更改 maxRequestLength,而且还必须为executionTimeout 提供更多秒数。
有趣的是:请考虑到在调试模式下会忽略此设置的值。 .NET Framework 2.0 中的默认值为 110 秒。 在 .NET Framework 1.0 和 1.1 中,默认值为 90 秒。
2.-谈论真正的解决方案,HttpModules就像免费的 NeatUpload
3.-解释另一种方式更直观地上传:Silverlight 或 flash swfupload
4.-他谈到了 II7 的一项限制。 在此页面中 http://www.telerik.com/help/aspnet-ajax/ upload_uploadinglargefiles.html 您可以找到 IIS 7 的更多有趣设置,设置最大 100 兆。
您添加:
并且您必须打开文件 C:\Windows\System32\inetsrv\config\applicationHost.config 并找到行:
更改为:
Galloway 提到的另一件有趣的事情:“在 ASP.NET 1.0 和 1.1 中,整个文件是在写入磁盘之前加载到内存中。ASP.NET 2.0 进行了改进,可以在上传过程中将文件流式传输到磁盘。”
对于 IIS6,Chris 给出的解决方案我认为是合适的:
http://www.banmanpro.com/support2/ File_Upload_limits.asp
另一个来源:
http://www.telerik.com/support/kb/aspnet-ajax/upload/page-not-found-error-when-uploading-large-files-on -win2003.aspx
另一个 URL,一个用户在这里测试了很多组件:
http://remy.supertext.ch/2008/01/file-upload-with-aspnet/
他引用了一个codeproject项目(!),这是使用大文件的另一个很好的例子并在此处闪烁:
http://www.codeproject.com/KB/aspnet/FlashUpload.aspx
I will extend my answer to your question to take into account other possible situations.
A very good link to learn about uploading big size files is this one:
http://weblogs.asp.net/jgalloway/archive/2008/01/08/large-file-uploads-in-asp-net.aspx
Here Jon Galloway explains the best techniques to treat the problem:
1.-Changing machine config or web.config:
Here you change not only the maxRequestLength, but you must give more seconds for the executionTimeout.
Interesting thing: Take into account that the value of this setting is ignored in debug mode. The default in .NET Framework 2.0 is 110 seconds. In the .NET Framework 1.0 and 1.1, the default is 90 seconds.
2.-Talking about the real solution, HttpModules like the free of charge NeatUpload
3.-Explaining another way of uploading more intuitively: Silverlight or flash swfupload
4.-He speaks about one restriction II7 has. In this page http://www.telerik.com/help/aspnet-ajax/upload_uploadinglargefiles.html you can find more interesting settings for IIS 7, to set a maximum of 100 megas.
You add:
And you must open the file C:\Windows\System32\inetsrv\config\applicationHost.config and find the line:
changing to:
Another interesting thing Galloway mentions: "In ASP.NET 1.0 and 1.1, the entire file was loaded into memory before being written to disk. There were improvements in ASP.NET 2.0 to stream the file to disk during the upload process."
For IIS6 the solution Chris gives I think is appropriate:
http://www.banmanpro.com/support2/File_Upload_limits.asp
Another source:
http://www.telerik.com/support/kb/aspnet-ajax/upload/page-not-found-error-when-uploading-large-files-on-win2003.aspx
Another URL where one user has tested a lot of components here:
http://remy.supertext.ch/2008/01/file-upload-with-aspnet/
He refers to a codeproject project (!) that is another very good example of using large files and flash here:
http://www.codeproject.com/KB/aspnet/FlashUpload.aspx
如果您使用的是 ASP .NET,则需要修改 maxRequestLength web.config 属性。
请参阅此链接。
If you're using ASP .NET, then you need to modify the maxRequestLength web.config property.
See this link.
我已经在这个问题上苦苦挣扎了几个小时,终于解决了我的特殊问题,我想在这里分享。
如果您使用 urlscan,其配置中有文件大小限制以及。 要对此进行更改,您需要编辑文件“UrlScan.ini”(通常)位于:
C:\WINDOWS\system32\inetsrv\urlscan
将“MaxAllowedContentLength”的值更改为您想要的值最大文件大小值。
I have been struggling with this issue for hours now and finally have solved my particular problem and I want to share it here.
If you are using urlscan, there is a file size limit in its configuration as well. To make changes to that, you need to edit the file "UrlScan.ini" located (typically) at:
C:\WINDOWS\system32\inetsrv\urlscan
Change the value for "MaxAllowedContentLength" to your desired max file size value.
如果您从 rad-control 上传文档,则只需使用这行代码即可。
这对我有用。
If you are uploading document from rad-control than you can just use this line of code.
It worked for me.