Windows Server 2012 R2与IIS 8.5和WebDAVfunction安装并启用。 它看起来像所有的基本工作:
$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
也:
$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>
更新:也发现curl命令从服务器上删除一个文件,并上传一个文件,他们都工作:
$curl --ntlm -u username:password -X DELETE http://server/file.docx $curl --ntlm -u username:password -T file.docx http://server/
基于所有的curltesting,基本的WebDAV似乎正在工作,但是无论我如何尝试在Microsoft Word中打开此文件/ URL,它只能打开只读。
我已经尝试将URL粘贴到MS Word的“打开文件”对话框中,我已经从命令行启动了Word以及该文件的URL,甚至还尝试了一些MS Office协议处理程序( ms-word:ofe|u|http://server/file.docx )。
每次我只读取。 有关如何使MS Office正确使用此WebDAV的任何build议? 我已经用另一个WebDAV实现(Atlassian Confluence)使用相同的MS Office,所以我希望这只是一些Officeconfiguration或命令行切换需要。
我没有足够的代表评论,所以我写作答案。
既然你说这个安装程序可以和Atlassian服务器一起工作,并且不能和你一起工作,那么我要debugging的问题是跟踪HTTP通信,看看request / respnse数据和头文件中有什么不同。
为此,我通常使用智能嗅探或wireshark 。
如果其中任何一个系统使用SSL,这将不会有帮助。
您需要打开WebDAV设置中的“源”选项才能使MS Office和许多其他工具与WebDAV正常工作。