Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...

When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Implementing a WebDAV filesystem with PHP and SabreDAV


In this article I've shown you how to create your own WebDAV server using PHP and the open-source library SabreDAV.

First I showed you how to set up a virtual host in Apache for your WebDAV server, then I showed you how to install SabreDAV. We also creating an area in your server's file structure for storing files managed by WebDAV.

Next I showed you how to get started with SabreDAV, which was simply a matter of specifying the storage directory then handling the request. In order for you to see the server's progress, I showed you how to map the WebDAV drive in both Windows and in OS X.

We then looked at the plug-in system of SabreDAV, which allowed us to extend our server easily by adding a web browser plug-in and a resource fork filter. Next we added file-locking capabilities to the server - required by some WebDAV clients before you can write files.

Once our server was fully functioning, I showed you how to implement an authentication system using HTTP Digest Authentication. This meant that users must provide a username and password in order to access the WebDAV server.

Finally, I briefly discussed how you can implement your own virutal filesystems in SabreDAV, allowing you to easily add WebDAV to an existing web application (such as a Content Management System).

Further Reading

Other Options

In This Article