0

Windows Server 2012 R2 with IIS 8.5 and the WebDAV feature installed and enabled. It looks like all the basics are working:

$curl --ntlm -u username:password -i -X OPTIONS http://server/file.docx

HTTP/1.1 200 OK
Allow: OPTIONS, TRACE, GET, HEAD, POST, COPY, PROPFIND, DELETE, MOVE, PROPPATCH, PUT, LOCK, UNLOCK
Server: Microsoft-IIS/8.5
Public: OPTIONS, TRACE, GET, HEAD, POST, PROPFIND, PROPPATCH, MKCOL, PUT, DELETE, COPY, MOVE, LOCK, UNLOCK
DAV: 1,2,3
MS-Author-Via: DAV
Persistent-Auth: true
X-Powered-By: ASP.NET
Date: Wed, 07 Dec 2016 05:10:15 GMT
Content-Length: 0

Also:

$curl --request PROPFIND --ntlm -u username:password  --header "Content-Type: text/xml" --header "Brief:t" --data "<D:propfind xmlns:D='DAV:'><D:prop><D:displayname/><D:getcontentlength/><D:getlastmodified/></D:prop></D:propfind>" http://server/file.docx

<?xml version="1.0" encoding="utf-8"?>
<D:multistatus xmlns:D="DAV:"><D:response>
<D:href>http://server/file.docx</D:href>
<D:propstat><D:status>HTTP/1.1 200 OK</D:status>
<D:prop>
<D:getlastmodified>Wed, 07 Dec 2016 04:26:19 GMT</D:getlastmodified>
<D:displayname>file.docx</D:displayname>
<D:getcontentlength>16265</D:getcontentlength>
</D:prop>
</D:propstat>
</D:response>
</D:multistatus>

UPDATE: Also found the curl commands to delete a file from the server and to upload a file, and they all work too:

$curl --ntlm -u username:password -X DELETE http://server/file.docx
$curl --ntlm -u username:password -T file.docx http://server/

Based on all the curl tests, the basic WebDAV seems to be working, but no matter how I try to open this file/URL in Microsoft Word, it only opens read-only.

I've tried pasting the URL into MS Word's "Open File" dialog box, I've launched Word from the command line with the URL to this file, I've even tried some MS Office protocol handlers (ms-word:ofe|u|http://server/file.docx) from a web page.

Every time I get read-only. Any suggestions on how to get MS Office to use this WebDAV properly? I've used the same MS Office with another WebDAV implementation (Atlassian Confluence), so I'm hoping it's just some Office config or command-line switch needed.

jimtut
  • 217
  • 1
  • 3
  • 13

2 Answers2

1

I don't have enough rep to comment, so I'm writing as answer.

Since you said that the setup works with Atlassian server and does not work with yours, what I would do to debug the problem is trace the HTTP communication and see what are diffferences in request/respnse data and headers.

For that I usually use smart sniff or wireshark.

This will not be helpful if either of those systems use SSL.

To Ka
  • 135
  • 1
  • 9
  • The Atlassian server uses SSL (HTTPS), but the one that I'm configuring with IIS is straight HTTP. Still, I'll try WireShark and see if I can see anything that's telling MS Office to drop back to read-only.... – jimtut Dec 07 '16 at 16:46
  • Couldn't understand WireShark's output, but tried SmartSniff, and it clearly showed me a "403.21" error when Word was opening the file. Googling for that error shows that I need to turn on the "Source" option within WebDAV. As soon as I did that, Word and read and write the file from the server. – jimtut Dec 07 '16 at 17:15
0

You need to turn on the "Source" option in the WebDAV settings in order to get MS Office and many other tools to work correctly with WebDAV.

Settings

jimtut
  • 217
  • 1
  • 3
  • 13