We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

URL RewritePath to get around the issue with WebDAV OPTIONS request handling [Answered]RSS

2 replies

Last post Jun 10, 2011 01:09 PM by robmcm

  • URL RewritePath to get around the issue with WebDAV OPTIONS request handling

    Jun 01, 2011 11:20 AM|uwking|LINK

    Hi,

    After having spent so many days watching this screen, I would like some confirmation here.

    **********************************************************************************
    C:\Documents and Settings\cchoi>net use * http://localhost/WebDAV/
    System error 67 has occurred.

    The network name cannot be found.
    **********************************************************************************

    Sometime ago, I learned from here, WebDAV OPTIONS request always points to the root of web application.

    Fine.

    So I decided to try using HttpContext.RewritePath to point to my subdirectory, and my code is as below:

    if (request.HttpMethod.Equals("OPTIONS"))
    {
          context.RewritePath("~/WebDAV", false);

          context.Response.StatusCode = 200;
          context.Response.StatusDescription = "OK";
          context.Response.AddHeader("DAV", "1, 2");
          context.Response.AddHeader("MS-Author-Via", "DAV");
          context.Response.AddHeader("Allow", "OPTIONS, TRACE, GET, HEAD, DELETE, PUT, POST, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH");
          context.Response.AddHeader("Accept-Ranges", "none");
          context.ApplicationInstance.CompleteRequest();
    }

    I set a breakpoint at this code, and run the command from the screen above.

    The code ran without any exception or error, but I still get the same 67 error.

    WebDAV Mini-Redirector usually sends OPTIONS & PROPFIND when the command above is sent.

    I looked at the Fiddler and see the fine set of requests/responses.

    *******************************************************************************
    OPTIONS http://cchoi/ HTTP/1.1
    translate: f
    User-Agent: Microsoft-WebDAV-MiniRedir/5.2.3790
    Host: cchoi
    Content-Length: 0
    Connection: Keep-Alive
    Pragma: no-cache

    *******************************************************************************
    HTTP/1.1 200 OK
    Date: Wed, 01 Jun 2011 15:10:34 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    DAV: 1, 2
    MS-Author-Via: DAV
    Allow: OPTIONS, TRACE, GET, HEAD, DELETE, PUT, POST, COPY, MOVE, MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH
    Accept-Ranges: bytes
    Cache-Control: private
    Content-Length: 0

    *******************************************************************************
    PROPFIND http://cchoi/WebDAV HTTP/1.1
    Depth: 0
    translate: f
    User-Agent: Microsoft-WebDAV-MiniRedir/5.2.3790
    Host: cchoi
    Content-Length: 0
    Connection: Keep-Alive
    Pragma: no-cache
    *******************************************************************************
    HTTP/1.1 207 Multi-Status
    Date: Wed, 01 Jun 2011 15:10:47 GMT
    Server: Microsoft-IIS/6.0
    X-AspNet-Version: 2.0.50727
    Content-Length: 759
    Cache-Control: private
    Content-Type: application/xml

    <?xml version="1.0"?>
    <D:multistatus xmlns:D="DAV:">
       <D:response>
          <D:href>http://cchoi/WebDAV</D:href>
          <D:propstat>
             <D:prop>
                <D:getcontentlength>29527120</D:getcontentlength>
                <D:creationdate>2011-04-07T10:14:19</D:creationdate>
                <D:displayname>WebDAV</D:displayname>
                <D:resourcetype><D:collection /></D:resourcetype>
                <D:getcontenttype>application/unknown</D:getcontenttype>
                <D:getlastmodified>Tue, 31 May 2011 14:52:59 GMT</D:getlastmodified>
                <D:supportedlock>
                   <D:lockentry>
                      <D:lockscope><D:exclusive /></D:lockscope>
                      <D:locktype><D:write /></D:locktype>
                   </D:lockentry>
                   <D:lockentry>
                      <D:lockscope><D:shared /></D:lockscope>
                      <D:locktype><D:write /></D:locktype>
                   </D:lockentry>
                </D:supportedlock>
             </D:prop>
             <D:status>HTTP/1.1 200 OK</D:status>
          </D:propstat>
       </D:response>
    </D:multistatus>
    *******************************************************************************

    Can somebody please guide me how to get around this System error 67 here?
    or is it EVEN possible to write your own custom HttpHandler using .NET managed code?
    and yes I have been to the list of general reasons for System error 67, and they do not fall in this situation.

    Thank you so much.

    IIS 6.0 WebDav IIS 6.0 Win2003 Pblishing WS iiS 6 WebDAV Mini-Redirector

  • Re: URL RewritePath to get around the issue with WebDAV OPTIONS request handling

    Jun 01, 2011 11:31 AM|uwking|LINK

    It doesn't look like my screen was embedded properly.

    but it  basically has the following

    **********************************************************************************
    C:\Documents and Settings\cchoi>net use * http://localhost/WebDAV/
    System error 67 has occurred.

    The network name cannot be found.
    **********************************************************************************

  • Re: URL RewritePath to get around the issue with WebDAV OPTIONS request handling

    Jun 10, 2011 01:09 PM|robmcm|LINK

    There are a few possible causes for the system error 67 that you are seeing that are documented in the following walkthrough:

    http://learn.iis.net/page.aspx/386/using-the-webdav-redirector/

    Robert McMurray [MSFT]