Flylib.com

Books Software

 
 
 

Accessing DAV Resources from Firefox


Accessing DAV Resources from Firefox

At the time of the writing of this book, Firefox does not include native support for accessing DAV resources. However, the Windows-only openwebfolder extension allows you to hook into the Microsoft Windows WebDAV component, allowing you to access DAV resources from within Firefox. It is available from http://openwebfolder.mozdev.org/.

To install it, just click on the XPI link at http://openwebfolder.mozdev.org/installation.html from within Firefox and follow the instructions. Once you have restarted Firefox, you can right-click any page and select Open as Web Folder from the pop-up to access it through WebDAV (see Figure 8.4).

Figure 8.4. Open a web folder from inside Firefox.




Accessing DAV from the Command Line


./cadaver


dav:!> open http://example.com


There are a number of command-line clients available to access DAV-enabled resources, allowing both for interactivity and easy integration within administrative scripts. They can be convenient replacements for their FTP and scp counterparts. Two of the most popular open source command-line clients are cadaver and sitecopy . cadaver is an interactive shell that provides FTP-style commands such as ls , put , get , and so on. The example shows how to use cadaver to access a DAV-enabled web server, list the available resources, and edit a remote file.

./cadaver
dav:!> open http://example.com
dav:/> ls
Listing collection `/': succeeded.
Coll:   images                                  0
Dec  7  2004
Coll:   styles                                  0
Dec 12  2004
        Home.html                            4816
Aug 14 14:19
        company.html                         5352
Dec  7  2004
        partners.html                        6087
Dec  7  2004
        solutions.html                       3037
Dec  7  2004
dav:/> edit solutions.html
Locking `solutions.html': succeeded.
Downloading `/solutions.html' to /tmp/cadaver-edit-
zEzdL9.html
Progress: [=============================>] 100.0% of
6230 bytes succeeded.
Running editor: `vi /tmp/cadaver-edit-
zEzdL9.html'...
Changes were made.
Uploading changes to `/solutions.html'
Progress: [=============================>] 100.0% of
6232 bytes succeeded.
Unlocking `solutions.html': succeeded.
dav:/>


cadaver can be downloaded from http://www.webdav.org/cadaver. sitecopy allows you to maintain a local document tree and a remote server synchronized using a variety of protocols, including DAV. It can be downloaded from http://www.lyra.org/sitecopy.



Dealing with Buggy Clients


BrowserMatch "Microsoft Data Access Internet


Publishing Provider" redirect-carefully


BrowserMatch "^gnome-vfs" redirect-carefully


If you can't connect to your DAV server using Microsoft web folders or older versions of Gnome virtual folders and you find something similar to

"OPTIONS /davdocs HTTP/1.1" 301


in your access log, you have hit a bug with certain client implementations of WebDAV. Apache is sending a redirect (HTTP code 301) to the client, but the client is getting confused and does not follow the redirect. Apache provides a workaround against this buggy behavior, skipping the redirect when the redirect-carefully environment variable is set. This example, included in the default Apache configuration file, sets the redirect-carefully environment variable for two WebDAV clients known to have the problems mentioned.