Managing and Syncing Zotero Attachments with Zotfile and Dropbox

If you are like me, you have never wondered just where Zotero stores its attachments. When you need to pull up an article, you would just fire up the app, select the entry and double-click - the attachment will magically open with the default PDF reader of the system! For me, the trouble started a few months back, when I wanted to access the articles on my android. Let’s face it, the mobile apps that support Zotero are horrible. So, I thought, maybe I can sync the attachments directly across Dropbox, and access them from wherever I want.

As I understand it, when you add a new article to Zotero, the app creates an unique id associated with it. The attachment, along the bibliographic information and any notes gets placed in a corresponding folder inside the data directory (by default, ~/Zotero on Mac and Linux). This makes quickly finding an article directly in data directory, without opening the app virtually impossible. More importantly, this under-the-hood processing by Zotero makes putting the data directory under any cloud sync service highly unsafe - if you add a new item without allowing the service to fully sync with could first, it will most certainly mess up the directory structure. If that happens, good luck with recovering your data!

Fortunately, there is an excellent plugin called ZotFile that can automatically move attachments to a custom folder. Let’s go over the steps necessary to enable it in Zotero. I am assuming you already have an account on zotero.org, and have an instance of the app up and running locally with sync on.

  • Install the ZotFile plugin following the instructions on the official website.

  • In the “Advanced” tab under Zotero preferences, change the base directory under “Files and Folders” to point to a custom directory that can be put under cloud sync. Make sure Zotero does not use absolute path (ensure that “Revert to Absolute Paths…” button is visible under the name of the Base directory).

  • Under ZotFile preferences (under the “Tools” menu), under the “General Settings” tab, change the “Location of Files” to point to the custom location from the previous step.

  • Now, in the “Advanced Settings” tab, change the “Automatically rename new attachments” to “Always rename”, and uncheck the two “Ask user…” options.

Once everything is set up, you can select any Zotero item, right click on it, and under the “Manage Attachments” sub-menu, select “Rename Attachments” — ZotFile will move the attachment to the base folder, create a link to the attachment and store it under the item. You can even do a batch rename by selecting more than one items! Now, it would be great if the renaming action could be triggered automatically every time a new item is added to Zotero, but I haven’t found a way to enable this feature.

I also made a few extra modifications “Renaming Rules” under Zotero prefernces — just so that the title would not be truncated after special characters or or a maximum number of characters.

comments powered by Disqus