我正在实现一个WebDAV服务器,但遇到了建议的客户端(Windows7Explorer)的问题。在windows中,我浏览到\ server \public\容器,我的服务器希望将其显示为包含两个文件的文件夹,因此我正在接收以下请求:
PROPFIND /public/container HTTP/1.1
Connection: Keep-Alive
User-Agent: Microsoft-WebDAV-MiniRedir/6.1.7601
Depth: 1
translate: f
Content-Length: 0
Host: devsys:4511
我的回应是:
HTTP/1.1 207 Multi-Status
Server: MyServer 2.12
Date: Mon, 08 Sep 14 17:57:50 -0000
Host: server.somewhere.com
Content-Type: text/xml; charset="utf-8"
Content-Length: 2901
<d:multistatus xmlns:d="DAV:">
<d:response>
<d:href>/public/container</d:href>
<d:propstat>
<d:prop>
<d:creationdate>2014-09-05T19:00:00Z</d:creationdate>
<d:displayname>container</d:displayname>
<d:resourcetype>
<d:collection/>
</d:resourcetype>
<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:response>
<d:href>/public/container/myFile1</d:href>
<d:propstat>
<d:prop>
<d:getcontenttype>text/plain</d:getcontenttype>
<d:getcontentlength>375</d:getcontentlength>
<d:getetag>"1410198520"</d:getetag>
<d:creationdate>2014-09-05T19:00:00Z</d:creationdate>
<d:displayname>myFile1</d:displayname>
<d:getlastmodified>05 Sep 2014 19:00:00 GMT</d:getlastmodified>
<d:resourcetype/>
<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:response>
<d:href>/public/container/myFile2</d:href>
<d:propstat>
<d:prop>
<d:getcontenttype>text/plain</d:getcontenttype>
<d:getcontentlength>375</d:getcontentlength>
<d:getetag>"1410198523"</d:getetag>
<d:creationdate>2014-09-05T19:00:00Z</d:creationdate>
<d:displayname>myFile2</d:displayname>
<d:getlastmodified>05 Sep 2014 19:00:00 GMT</d:getlastmodified>
<d:resourcetype/>
<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>
Windows友好地给出了错误\myserver\public\容器无法访问。您可能没有使用此网络资源的权限。请与服务器管理员联系,了解您是否具有访问权限。参数不正确。
它似乎没有给出它可能是什么参数,也没有给出它不正确的原因。有人能发现这个明显的错误吗?我是错过了Windows需要的一个属性,还是做错了什么?
服务器在C中,所以我可以对响应进行字节级控制。
谢谢-罗格
发布于 2014-09-09 05:38:30
建议:使用多个客户端进行测试(如数码港)。
上面的PROPFIND响应是不正确的;它在没有名称空间中有“多状态”,但是它应该在"DAV:“命名空间中。
https://stackoverflow.com/questions/25730734
复制相似问题