C# HttpHandler 接受 PUT 请求上传内容
我编写了一个 HTTPHandler(用 C# 编写)来接受 GET 和 PUT 请求,基本上允许远程客户端检索和更新资源。
该处理程序在我的开发机器上本地工作正常,但是我在服务器上运行它时遇到了问题。
Web服务器是IIS6(在W2K3服务器上运行)。
我已将 NTFS 配置为允许 ASPNET 用户写入网站下的特定区域,这样 ASP.NET 就不会遇到文件安全问题。 我检查了我的 Web.config,发现我添加了两个动词“GET,PUT”。
然而,PUT 请求的响应始终是 403 Forbbiden。
HTTP/1.1 403 Forbidden
Via: 1.1 WMEPROXY
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 213
Date: Thu, 21 Jan 2010 14:47:30 GMT
Content-Type: text/html
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
<html><head><title>Error</title></head><body><head><title>Execute Access Denied</title></head>
<body><h1>Execute Access Denied</h1>This Virtual Directory does not allow objects to be executed.</body></body></html>
我错过了什么想法吗?
I've written an HTTPHandler (in C#) to accept GET and PUT requests, to basically allow resource to be retrieved and updated by a remote client.
The handler works fine locally on my dev machine however I run into issues running it on the server.
The web server server is IIS6 (running on a W2K3 Server box).
I've configured NTFS to permit the ASPNET user to write to specific areas under the website so ASP.NET shouldn't be hitting file security issues.
I've checked my Web.config that I've added both verbs "GET,PUT".
However the response from a PUT request is always 403 Forbbiden.
HTTP/1.1 403 Forbidden
Via: 1.1 WMEPROXY
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Content-Length: 213
Date: Thu, 21 Jan 2010 14:47:30 GMT
Content-Type: text/html
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
<html><head><title>Error</title></head><body><head><title>Execute Access Denied</title></head>
<body><h1>Execute Access Denied</h1>This Virtual Directory does not allow objects to be executed.</body></body></html>
Any ideas what I've missed?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将
PUT
谓词添加到 IIS 中的ashx
扩展中:(来源:15seconds.com)
You need to add the
PUT
verb to theashx
extension in IIS:(source: 15seconds.com)