Windows2003中IIS6.0文件上传大小限制解决方法

2006年05月23日 23:16,盛传发表在技术与应用,标签为,

Upload large files on Windows 2003 server

Question:
问题描述:

——————————————————————————–
Does Pure ASP Upload support uploading large files on Windows 2003 server? I’m getting the following error:
Request object error ‘ASP 0104 : 80004005′
Operation not Allowed
/ScriptLibrary/incPureUpload.asp, line 40

上传大文件到 Windows 2003 server + IIS 6.0 服务器的时候遇到下列错误:
请求对象错误 ‘ASP 0104 : 80004005′
操作被禁止
/ScriptLibrary/incPureUpload.asp, 行 40

Answer:
原因:

——————————————————————————–
Yes, Pure ASP Upload supports uploading large files on the Windows 2003 server. However:
IIS6.0 prevent the upload of files more than +200Kb. So you need to make some changes in the default IIS settings first.

采用纯ASP技术上传大文件到Windows2003服务器,无论如何IIS6.0 禁止上传超过 200kB 的文件. 因此你需要修改 IIS 的默认设置.

Background
技术背景:

——————————————————————————–
For IIS6.0 users, the AspMaxRequestEntityAllowed property specifies the maximum number of bytes allowed in the entity body of an ASP request. If a Content-Length header is present and specifies an amount of data greater than the value of AspMaxRequestEntityAllowed, IIS returns a 403 error response.

This property is related in function to MaxRequestEntityAllowed, but is specific to ASP request. Whereas you might set the MaxRequestEntityAllowed property to 1 MB at the general World Wide Web Publishing Service (WWW Service) level, you may choose to set AspMaxRequestEntityAllowed to a lower value, if you know that your specific ASP applications handle a smaller amount of data.

在 IIS 6.0 中, AspMaxRequestEntityAllowed 属性指定了一个 ASP 请求(Request)可以使用的最大字节数. 如果 Content-Length 头信息中包含的请求长度超过了 AspMaxRequestEntityAllowed 的值, IIS 将返回一个 403 错误信息.
这个属性值与 MaxRequestEntityAllowed 相似, 但是是针对 ASP 请求的. 假如你知道自己的 ASP 应用只需要处理很少的请求数据, 你可以在 World Wide Web Publishing Service (WWW 发布服务)层级设定全局的 MaxRequestEntityAllowed 属性为 1MB, 并单独设定 AspMaxRequestEntityAllowed 为一个较小的值.[鱼网·盛传媒体]

Solution:
解决方案

——————————————————————————–
Open your metabase.XML which is located in c:\Windows\System32\Inetsrv find the line “AspMaxRequestEntityAllowed” and change it to “1073741824″. This is 1GB - of course you can enter another value to suite your needs.

打开位于 C:\Windows\System32\Inetsrv 中的 metabase.XML, 并修改 AspMaxRequestEntityAllowed行为你需要的值单位:Byte(例如 “1073741824″, 1GB)默认为204800Byte.

NOTE: Before you edit the file, be sure to stop the IIS service first or else you won’t be able to save the file.
提示:在编辑文件前请停止 IIS 服务, 否则无法保存修改后的文件.
停止方法之一:命令行方式
停止:运行iisreset /stop
启动:运行iisreset /start

关于IISreset的详细信息见下:

IISRESET.EXE (C) Microsoft Corp. 1998-1999

用法: iisreset [computername]

/RESTART  停止然后重新启动所有 Internet 服务。

/START启动所有 Internet 服务。

/STOP 停止所有 Internet 服务。

/REBOOT   重新启动计算机。

/REBOOTONERROR如果在启动、停止或重新启动 Internet 服务时出错,则重新启动计算机。

/NOFORCE  如果试图正常停止服务失败,不强制终止 Internet 服务。

/TIMEOUT:val  指定等待 Internet 服务的成功停止的超时值(以秒为单位)。

  如果已指定 REBOOTONERROR 参数,超时后可以重新启动计算机。

  服务重新启动的默认值为 20 秒,停止为 60 秒,计算机重新启动为 0 秒。

/STATUS   显示所有 Internet 服务的状态。

/ENABLE   启用本地系统上 Internet 服务的重新启动。

/DISABLE  禁用本地系统上 Internet 服务的重新启动。

目前还没有评论 我要发表评论   订阅本文评论

暂时还没有评论内容。

发表评论很博客,因你参与更精彩!