Proudly Presenting … phpZoteroWebDAV 2.0 – a php-based zotero WebDAV server and library viewer (incl attachments)
At some point in 2008, zotero added a “sync” feature to allow people who were using multiple computers to sync their zotero libraries across these computers, including WebDAV-based syncing for attachments (e.g. pdf versions of journal articles or e-books, or snapshots of websites).
Since then they have expanded their offering to sync to their own attachment server, but once the free 100MB storage is exceeded (my own library is currently just shy of 2GB), payment is required (in my case $5 a month). This is not all that bad and if they had offered this back in 2008 I might have considered it, but they didn’t and since I pay about that much for my webhosting anyway I figured there should be a way to use my webhosting account for zotero sync.
The problem was that my webhoster’s WebDAV server run on a non-standard port which was blocked by my University (where one of the to-be-synced computers was located). So the task was to write a program that would enable the use of my webhosting account as WebDAV server on a standard port.
At the time, I was coding a lot in php (a server scripting language) and so I stumbled upon a WebDAV class implementation in PEAR, a collection of various php extensions. Using this class, I programmed the first version of phpZoteroWebDAV (November 2008), a very basic WebDAV server written in php (basic in that it only supports the subset of WebDAV features that zotero’s sync uses). I shared this with the zotero community where it was well received, especially since there are so many free (as in free beer) php enabled web hosting services available.
The Other Problem
Since then, a lot of exciting improvements have been made by the zotero team to their program and one of them was the aforementioned offering to sync to zotero’s own servers which also allows the user to view their synced file attachments on the web using the zotero website (before that, attachments were only viewable on locally installed zotero clients). Users of my script (or, indeed, any other WebDAV based sync solutions) were not able to view their attachments in this way since the zotero website could not connect to these other servers.
Thus, what I wanted was a feature expansion of my own script that would display users’ libraries on their own websites and then allow them to access the attachment items synced there. Incidentally, this would also solve what I call the “ToS problem” which refers to the use of my script probably being in violation of the Terms of Service of most webhosting providers who allow only storage of files that are related to a website and not just random files. This feature expansion would make the data synced to phpZoteroWebDAV more like an actual website rather than just a file server, thus probably bringing it in compliance with these ToS. Incidentally this would also solve security/privacy concerns that some users had with syncing their data to a server in the USA while that country still has the PATRIOT act.
The Other Solution
This new feature set was enabled by another great new zotero feature: the zotero server API. With this, I was able to relatively easily query a user’s zotero library in order to display it in a user-friendly format and then to let users go deeper into their library by viewing item details and attachments. This feature is very similar in function and design to that on the zotero.org website (and does, in fact, use zotero’s own stylesheet) but navigation is a bit different (read: better) and unlike zotero’s own attachment view, it can display web snapshots as well.
Now I am proudly presenting to the world phpZoteroWebDAV 2.0.