windows 您在实施/使用 WebDAV 方面有何经验?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/360609/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 11:43:50  来源:igfitidea点击:

What are your experiences implementing/using WebDAV?

asp.netwindowsmacosfilesystemswebdav

提问by Frank Krueger

For a current project, I was thinking of implementing WebDAV to present a virtual file store that clients can access. I have only done Google research so far but it looks like I can get away with only implementing two methods:

对于当前的项目,我正在考虑实施 WebDAV 来呈现客户端可以访问的虚拟文件存储。到目前为止,我只做过谷歌研究,但看起来我可以只实施两种方法:

GET, PROPFIND

I think that this is great. I was just curious though. If I wanted to implement file uploading via:

我认为这很棒。我只是好奇。如果我想通过以下方式实现文件上传:

PUT

I haven't implemented it, but it seems simple enough. My only concern is whether a progress meter will be displayed for the user if they are using standard Vista Explorer or OSX Finder.

我还没有实现它,但它看起来很简单。我唯一关心的是,如果用户使用标准的 Vista Explorer 或 OSX Finder,是否会为他们显示进度表。

I guess I'm looking for some stories from people experienced with WebDAV.

我想我正在寻找一些有 WebDAV 经验的人的故事。

回答by Julian Reschke

For many WebDAV clients and even for read only access, you will also need to support OPTIONS. If you want to support upload, PUT obviously is required, and some clients (MacOS X?) will require locking support.

对于许多 WebDAV 客户端,甚至对于只读访问,您还需要支持 OPTIONS。如果要支持上传,显然需要 PUT,并且某些客户端(MacOS X?)将需要锁定支持。

(btw, RFC 4918is the authorative source of information).

(顺便说一句,RFC 4918是信息的权威来源)。

回答by Nick Farina

I implemented most of the WebDAV protocol in about a day's work: http://github.com/nfarina/simpledav

我在大约一天的工作中实现了大部分 WebDAV 协议:http: //github.com/nfarina/simpledav

I wrote it in Python to run on Google App Engine, and I expect any other language would be a similar effort. All in all, it's about two pages of code.

我用 Python 编写它以在 Google App Engine 上运行,我希望任何其他语言都可以进行类似的工作。总而言之,它大约是两页代码。

I implemented following methods: OPTIONS, PROPFIND, MKCOL, DELETE, MOVE, PUT, GET. So far I've tested Transmit and Cyberduck and both work great with it.

我实现了以下方法:OPTIONS、PROPFIND、MKCOL、DELETE、MOVE、PUT、GET。到目前为止,我已经测试了 Transmit 和 Cyber​​duck,两者都可以很好地配合使用。

Hopefully this can provide some guidance for the next person out there interested in implementing a WebDAV server. It's not a difficult protocol, it's just very dense with abstracted language like 'depth' and 'collections' and blah.

希望这可以为下一个对实现 WebDAV 服务器感兴趣的人提供一些指导。这不是一个困难的协议,它只是非常密集的抽象语言,如“深度”和“集合”等等。

Here's the spec: http://www.webdav.org/specs/rfc4918.html

这是规范:http: //www.webdav.org/specs/rfc4918.html

But the best way to understand the protocol is to watch a client interacting with a working server. I used Transmit to connect to Box.net's WebDAV server and monitored traffic with Charles Proxy.

但是理解协议的最好方法是观察客户端与工作服务器的交互。我使用 Transmit 连接到 Box.net 的 WebDAV 服务器并使用 Charles Proxy 监控流量。

回答by Evert

Bit late to the party, but I've implemented most of the webdav protocol and I can tell with confidence you'll need to implement most of the protocol.

参加聚会有点晚了,但我已经实现了大部分 webdav 协议,我可以自信地告诉您,您需要实现大部分协议。

For OS/X you'll need class-2 WebDAV support, which includes LOCK and UNLOCK (I found it particularly difficult to fully implement the http If: header, but for Finder you'll only need a bit of that.)

对于 OS/X,您需要 class-2 WebDAV 支持,其中包括 LOCK 和 UNLOCK(我发现完全实现 http If: 标头特别困难,但对于 Finder,您只需要一点点。)

These are some of my personal findings:

以下是我个人的一些发现:

http://sabre.io/dav/clients/windows/http://sabre.io/dav/clients/finder/

http://sabre.io/dav/clients/windows/ http://sabre.io/dav/clients/finder/

Hope this helps

希望这可以帮助

回答by pvgoddijn

We have a webDAV servlet on our web based product.

我们在基于 Web 的产品上有一个 webDAV servlet。

i've found Apache Hymanrabbit a good help for implementing it. however webDav is a serious P.I.T.A on the client side support.

我发现 Apache Hymanrabbit 对实现它很有帮助。然而,webDav 在客户端支持方面是一个严肃的 PITA。

many client implementation differ widely in their behavior and you most likely will have to support several different kinds of bugged implementations.

许多客户端实现的行为差异很大,您很可能必须支持几种不同类型的错误实现。

some examples: MS vista only supports authentication over SSL

一些示例:MS vista 仅支持通过 SSL 的身份验证

most windows based webDAV client assume your webdav-server/let is a sharepoint server and will act accordingly (thus not according to the webDAV protocol)

大多数基于 Windows 的 webDAV 客户端假定您的 webdav-server/let 是共享点服务器,并会相应地采取行动(因此不根据 webDAV 协议)

one example of this is that you NEED to allow and Unauthenticated LOCK request on the root of your server (ie yourdomain.com/ not yourdomain.com/where/webdav/should/live) else you wont be able to get write acces in MS windows. (this is a serious P.I.T.A on a tomcat machine where your stuff usualy lives in server.com/servlets/paths/thelocation)

其中一个例子是,您需要在服务器的根目录(即 yourdomain.com/ 而不是 yourdomain.com/where/webdav/should/live)上允许和未经身份验证的 LOCK 请求,否则您将无法在 MS 中获得写入权限视窗。(这是您的东西通常位于 server.com/servlets/paths/thelocation 的 tomcat 机器上的严重 PITA)

most(all?) versions of MS office respond different to webdav links.

大多数(全部?)版本的 MS Office 对 webdav 链接的响应不同。

i guess my point is integrating webdav support into an existing product can be a LOT harder then you would expect. and if possible i would advice to use a (semi)-standalone webDAV server such as Hymanrabbit webdavServer, or apache mod_webdav

我想我的观点是将 webdav 支持集成到现有产品中可能比您预期的要困难得多。如果可能的话,我建议使用(半)独立的 webDAV 服务器,例如 Hymanrabbit webdavServer 或 apache mod_webdav

回答by Chinnery

If you run Apache Hymanrabbit under, say, Tomcat, it can be configured to offer WebDAV and store uploaded files. Perhaps that will be a useful model, or even a good enough replacement for the planned implementation.

如果您在 Tomcat 下运行 Apache Hymanrabbit,它可以配置为提供 WebDAV 并存储上传的文件。也许这将是一个有用的模型,甚至是计划实施的一个足够好的替代品。

Apache Hymanrabbit Support for WebDAV

Apache Hymanrabbit 对 WebDAV 的支持

Also, you may want to be aware of the BitKinex client (free 30 day trial), which I have found to be a useful tool for testing a WebDAV server.

此外,您可能希望了解 BitKinex 客户端(30 天免费试用),我发现它是测试 WebDAV 服务器的有用工具。

BitKinex Home Page

BitKinex 主页

回答by tvanfosson

We use WebDAV internally to provide a folder-based view of some file shares to clients outside of our firewall. We're using IIS6 for this.

我们在内部使用 WebDAV 向防火墙外的客户端提供一些文件共享的基于文件夹的视图。我们为此使用 IIS6。

Basically, it boils down to creating a Virtual Directory in IIS that maps to each network file system that you want to make available via WebDAV. Set it up with the content coming from "A share located on another computer" -- use the UNC path to the share for the Network Directory value. We turn on all options except Index this resource. Disable all default content pages. Turn on Windows Integrated Authentication (ours is set up using SSL as well). I have the root set up to deny access to anonymous and allow access to any authenticated user. We also have a wildcard MIME mapping (.* to application/octet-stream). Enable the WebDAV web service extension in IIS. You also need to set up the web server to delegate permissions to all the file servers you may be accessing so it can pass on the user's credentials.

基本上,它归结为在 IIS 中创建一个虚拟目录,该目录映射到您希望通过 WebDAV 提供的每个网络文件系统。使用来自“位于另一台计算机上的共享”的内容进行设置——使用共享的 UNC 路径作为网络目录值。我们打开除索引此资源之外的所有选项。禁用所有默认内容页面。打开 Windows 集成身份验证(我们的也是使用 SSL 设置的)。我将 root 设置为拒绝匿名访问并允许访问任何经过身份验证的用户。我们还有一个通配符 MIME 映射(.* 到 application/octet-stream)。在 IIS 中启用 WebDAV Web 服务扩展。您还需要设置 Web 服务器以将权限委派给您可能正在访问的所有文件服务器,以便它可以传递用户的凭据。

If you have Macintosh clients you may also need an ISAPI filter that maps 401 to 403 errors for Darwin clients. Microsoft and Apple disagree on how to handle the situation when you don't have permission to write to a directory. Apple keeps resending the credentials on a 401 (Access Denied) error, translating it to a 403 (Forbidden) error keeps this from happening. By default Apple likes to write a "dot" file to every directory it accesses. Navigating through directories where you don't have write access will end up crashing the Finder if you don't have the filter. I have source code for this if needed.

如果您有 Macintosh 客户端,您可能还需要一个 ISAPI 过滤器来为 Darwin 客户端映射 401 到 403 错误。当您没有写入目录的权限时,Microsoft 和 Apple 就如何处理这种情况存在分歧。Apple 不断在 401(拒绝访问)错误上重新发送凭据,将其转换为 403(禁止访问)错误可防止这种情况发生。默认情况下,Apple 喜欢将“点”文件写入它访问的每个目录。如果您没有过滤器,在您没有写访问权限的目录中导航最终会导致 Finder 崩溃。如果需要,我有这方面的源代码。

This is all off the top of my head. It's possible (probable?) that I may have missed something. Feel free to contact me via the contact information on my web site if you have problems.

这一切都在我的脑海中。有可能(可能?)我错过了一些东西。如果您有问题,请随时通过我网站上的联系信息与我联系。

回答by Matthew Schinckel

I've found OS X's Finder WebDAV support to be really finicky. In order to get read-write support, you have to implement LOCK, in addition to other bits.

我发现 OS X 的 Finder WebDAV 支持非常挑剔。为了获得读写支持,除了其他位之外,您还必须实现 LOCK。

I wrote a WebDAV interface to a Postres database, where python modules were stored in the database in a hierarchical folder-like structure. Accessing it with cadaver worked fine, and IIRC a GUI windows browser worked too, but Finder refused to mount the share as anything other than read-only.

我为 Postres 数据库编写了一个 WebDAV 接口,其中 Python 模块以类似文件夹的分层结构存储在数据库中。使用 cadaver 访问它工作正常,并且 IIRC 一个 GUI Windows 浏览器也可以工作,但 Finder 拒绝将共享安装为只读以外的任何内容。

So, I don't know if if would give a progress bar. The files I was dealing with were small enough that a read/copy from them was virtually instantaneous. I think a copy of a large file using the Finder would probably give a progress bar - it does for any other type of mounted share.

所以,我不知道是否会给出进度条。我正在处理的文件足够小,从它们读取/复制几乎是即时的。我认为使用 Finder 的大文件副本可能会给出一个进度条——它适用于任何其他类型的挂载共享。

回答by mar10

Here is another open source project for WSGI WebDAV http://code.google.com/p/wsgidav/where I picked up the PyFileServer project.

这是 WSGI WebDAV http://code.google.com/p/wsgidav/ 的另一个开源项目 ,我在那里选择了 PyFileServer 项目。