Mobile app version of vmapp.org
Login or Join
Angela700

: Configure Apache HTTP 2.2 for PUT method I've written code for file upload and download using HttpWebRequest/HttpWebResponse class in C# with Apache 2.2 as a web server. In code I'm using request.method

@Angela700

Posted in: #Apache #Http #HttpdConf

I've written code for file upload and download using HttpWebRequest/HttpWebResponse class in C# with Apache 2.2 as a web server. In code I'm using request.method = "PUT".

I want to config my HTTP config file to support PUT method. I write PUT method script as:

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


That's not working. It shows error at program output: (405) The method not allowed.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Angela700

1 Comments

Sorted by latest first Latest Oldest Best

 

@Sims2060225

Your <Dav On directive is not complete (no need for <) -- I assume it's just a copy-paste issue.
More importantly -- you are using <Location> directive ... but providing physical path on your file system/hard drive.

That's wrong -- <Location> is used to match URLs, not directories; to match directories you need to use <Directory>. Please refer to Apache manual: httpd.apache.org/docs/current/mod/core.html#location
You most likely need to use <Location /output> instead (or use <Directory> instead of <Location>) -- that's my guess based on the amount of config data you have provided.


Taking the above into consideration you will need something like this (sorry, I cannot connect to my Apache box to test it):

<Location /output>
Dav On
<LimitExcept GET HEAD OPTIONS PUT>
Allow from all
</LimitExcept>
</Location>

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme