Proudly Presenting … phpZoteroWebDAV 2.0 – a php-based zotero WebDAV server and library viewer (incl attachments)

By , 2 November 2011 14:21


Zotero is an awesome piece of reference management software. It’s free (as in free beer as well as in free speech, if you know what I mean) and very cool for many reasons that I won’t get into here.

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

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.

The Solution

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 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.

If you are interested in checking if out yourself, head over to the installation and download page or follow the project on github.

7 Responses to “Proudly Presenting … phpZoteroWebDAV 2.0 – a php-based zotero WebDAV server and library viewer (incl attachments)”

  1. olaf berg says:

    Hi Krueschan,

    sounds like a very good an useful script. Thanks for sharing it!
    I wounder if it also works for creating and syncing zotero groups. The background: The internet security policy at my research institute does not allow to store information on foreign servers. We have some groups of researchers that would like to share a common bibliography. If your script would work with zotero groups as well I could ask our IT to install it in our intranet for the group.

    • krueschan says:

      Sorry, Olaf. Zotero’s data model does not allow group attachments to be synced to WebDAV servers. The only way of doing it is to install your own zotero server (the server code is released and this has been done by others, but might be hardish). The only other way that I know of is to use the same user account. But again, either way, the biliography will still be synced to (and stored on) servers, only attachments would be moved elsewhere.

  2. Dear Mr. Holz,

    I am running into a few issues with my server connection I was hoping you could help with.

    Here’s what I running:

    -Zotero Standalone with Chrome

    -and Firefox addon (depends on what browser I feel like for the day)

    Server space through 1and1. Located at:

    Also, using phpZoteroWebDAV 2.0.
    Zotero data syncs fine, go to and it works great.
    Webdav file sync is having issues.

    Here’s what I have tried:

    -Permissions error for all usernames, passwords tried


    -Permissions error for all usernames, passwords tried


    -When I put no username/password, I get:
    doesn’t recognize username and password error

    -When I put in random username/password I get
    doesn’t recognize username and password error

    -When I put in ftp password to this specific directory I get:
    doesn’t recognize username and password error

    -When I put in default ftp username/password for the root directory I get:
    error -8

    1and1 says I should use that last combination (default ftp username/password and port 81)

    Not sure where to go from here. Thank you for your help.

  3. Fred says:

    As far as I understand Zotero does not allow anymore synchronization with other than the Zotero server.

    • krueschan says:

      What makes you think that? I just downloaded version 4.0.11 of Zotero (standalone Mac) and the familiar choice between Zotero and WebDAV is still present in the “file syncing” section of the sync settings… I haven’t had the time to test it, but I don’t see why it shouldn’t work as in the past?
      Please clarify.

  4. Fred says:

    Well I see; you are right; My fault; I have to apologize for bothering you.

    You have to change Zotero into WebDAV in the select box before you can see all the text input boxes to enter your own web server address. At the first glance the settings dialog looks as if supporting the zotero server only.

    After all, your server is great news. Actually, for a while I’m trying to develop a similar piece of software (a front-end web server rather than a data sync server). Now, I’m going to check out your work and test how it may integrate.

Leave a Reply

Panorama Theme by Themocracy