iisiis-7

"405 method not allowed" in IIS7.5 for "PUT" method


I use WebClient type to upload *.cab files to my server. On the server side, I registered a HTTP handler for *.cab file with the PUT method as below:

 <add name="ResultHandler" path="*.cab" verb="PUT" type="FileUploadApplication.ResultHandler" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />

But I always get a "405 method not allowed" error. The response said the allowed methods are as below:

Headers = {Allow: GET, HEAD, OPTIONS, TRACE
Content-Length: 1293
Content-Type: text/html
Date: Fri, 27 May 2011 02:08:18 GMT
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET}

Even if I explicitly allow the PUT method in the IIS Request Filtering for my web application, the same error still occurs.

I suspect this is a IIS related issue. I'm hoping someone could shed some light on this for me.


Solution

  • I enabled the Failed Request Tracing, and got the following info:

     <EventData>
      <Data Name="ContextId">{00000000-0000-0000-0F00-0080000000FA}</Data>
      <Data Name="ModuleName">WebDAVModule</Data>
      <Data Name="Notification">16</Data>
      <Data Name="HttpStatus">405</Data>
      <Data Name="HttpReason">Method Not Allowed</Data>
      <Data Name="HttpSubStatus">0</Data>
      <Data Name="ErrorCode">0</Data>
      <Data Name="ConfigExceptionInfo"></Data>
     </EventData>
    

    So, I uninstalled the WebDAVModule from my IIS, everything is fine now~

    The IIS tracing feature is very helpful.