No on-line storage, please!

edited September 4, 2024
I don't want Zotero to store ANY files from my libraries. They are all already stored on my hard drive (aka a Google Drive), and I link them through Zotero, thank you. How do I stop Zotero from uploading them? There are thousands of entries on my desktop Zotero app, so I can't go through each and pull them. Zotero is also surreptitiously making its own copies of my local pdfs and storing them on my hard drive.
  • You can disable file syncing in the Zotero preferences under "Sync"
  • And be sure to add files as “linked files” when you add them to Zotero https://www.zotero.org/support/attaching_files
  • edited September 5, 2024
    To search for any PDFs that have *not* been saved as linked files (which means they will get uploaded to Zotero servers if file syncing is turned ON), you can do a search in your OS under the Zotero\storage hierarchy for *.PDF. There are different ways to add PDFs to Zotero, and not all are intercepted by the plugins that people use to automate moving/linking PDF attachment files (eg Zotfile under Zotero v6, and zotmoov or attanger under Zotero v7). So it's not uncommon to find a few PDFs under Zotero\storage, which you can then move/link from within Zotero.
  • I had the same question. Thanks for your answer @tim820. I've been reading the forum today about switching to v 7 as a zotfile user and your posts have been so useful and clear.

    I haven't dug into javascripting using tools/developer/run JavaScript so I'm not sure of the capabilities, but is possible to have a code snippet that will find all of the library items with stored (not linked) attachments and highlight them in the UI--from where they could all be renamed and moved at once using a plugin, with a single right click?

    And a related maybe dumb question: after moving attachments out of zotero storage to a linked directory, are the remaining Zotero/storage/*/.zotero-ft-info files still needed for something? I can make a new question if that's better form.

    Thanks for a great tool!
  • Yes, those are the index files used for full text search.
  • @jiversen I don't know of any way to highlight/select only attachments that are in local storage (under Zotero\storage). But at least getting a *list* of files in local storage is possible (in addition to the OS search I mentioned) - see below.

    Note that while most attachments for most people are probably PDF, any file type can be an attachment. So users may also have EPUB, DOCX, XLSX, PPTX, JPG, PNG, MP4, MP3, WAV, etc. Also, you will likely also have HTML web page snapshot files (since Zotero started storing those as single files in 2020 [version 5.0.93]; before that snapshots were stored as multiple files). So if your aim is to move *every* attachment file type out of local storage, you would have to include all the attachment file types that you have.

    In Zotfile, you could limit which file types it moved/linked. I used that option, but simply set a long list of attachment file types that I have, and wished to move. However, IIRC Zotfile ignored HTML snapshots, regardless of that setting. They can take up a lot of space if you have a lot of snapshots. And so if file syncing is turned ON, they can drain your Zotero online file storage quota. The two new plugins that can replace Zotfile in Zotero v7, Zotmoov and Attanger, both allow you to limit the file types they handle, as Zotfile did. I see that Zotmoov does now handle HMTL files (github issue #33 discusses that). I am not sure about Attanger.

    Images in notes are also stored locally (and transparently to the user), as PNG files. I don't know of any way to avoid those being uploaded when file syncing is ON.

    You can get a list of attachment files in local Zotero storage with the following code run under Tools\Developer\Run Javascript:

    var datadir = Zotero.DataDirectory.dir;
    var sql = "SELECT (? || ? || key || ? || REPLACE(path,?,?)) AS filepathnames FROM itemAttachments JOIN items USING (itemID) WHERE libraryID=1 AND path IS NOT NULL AND path LIKE ? ORDER BY filepathnames";
    var filepathnames = await Zotero.DB.columnQueryAsync(
    sql,
    [
    datadir,
    '\\storage\\',
    '\\',
    'storage:',
    '',
    'storage:%'
    ]
    );
    return filepathnames.join('\n');

    (maybe someone can modify that code to select/highlight all the attachments found ?)

    Note that this is for Windows. For Mac/linux, use forward slashes (/). If you wish to limit the list to just PDFs (for example), replace storage:% (near the end) with storage:%.pdf.

    Zutilo can also be used to copy the paths of selected items' attachments to the clipboard. But it does not work with Zotero v7 as yet.

    Going from a list of attachments to locating their items in Zotero - so that they can be moved/linked - is a little more complicated (because those attachments have not been selected in the UI). If a listed file name is not sufficient to locate their Zotero item, the folder name (eg 23G3MICM) can be entered under a quick search at the My Library level, set for All Fields & Tags.

    It is of course possible to just select *all* items and use the right-click rename/move plugin option (although it is often best to do such bulk operations in smaller chunks). Any files that are *already* linked/renamed will simply be re-linked/re-renamed.
  • Thanks for the helpful answers!

    @bwiernik When I look at the contents of .zotero-ft-info files they are just metadata about a pdf file (including the pdf version, page size, etc).

    .zotero-ft-cache files do indeed appear to be text dumps of the pdf that I can see as essential for searching. Most folders do not appear to have this, however, while most every folder has a .zotero-ft-info file. It's really not a big deal, they aren't large, so just my curiosity at this point.

    @tim820 Much appreciated! I'll try the javascript, though your last comment seems simplest! Thanks also for the insights about file types and other considerations for storage space.
Sign In or Register to comment.