为PUT方法配置Apache HTTP 2.2

时间:2011-08-29 07:08:35

标签: c# apache httpwebrequest

我已经使用Apache HTTP服务器v2.2在C#中使用HttpWebRequestHttpWebResponse类编写了文件上载和下载代码。在代码中,我使用'request.method =“PUT”',所以我想配置我的httpconfig文件以支持PUT方法。我将PUT方法脚本编写为

<Location "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/output">
    <Dav On
    <LimitExcept GET HEAD OPTIONS PUT>
    <Allow from all
    </LimitExcept>
</Location>

那不行。如何使它工作?

1 个答案:

答案 0 :(得分:0)

尝试如下配置。您将需要一个处理PUT请求的程序/处理程序的正确路径。

<Location "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/output">
Dav On
<LimitExcept GET HEAD OPTIONS PUT>
<Allow from all>
</LimitExcept>
Script PUT {path to PUT handler}
</Location>