Home-dir-relative storage of linked files.

124»
  • willshanks,
    Yes, using "U" and "E" works (case sensitive). Thanks for your help (and the plugin).
  • oldenborger, I am glad that fixed your problem. A more general fix is now available in version 1.1.15 here:

    https://addons.mozilla.org/en-US/firefox/addon/zutilo-utility-for-zotero/versions/?page=1#version-1.1.15

    That should allow you to change more than just the drive letter if you want to.
  • edited January 17, 2013
    I updated Zutilo again to address the issue raised by hatepod above:

    https://addons.mozilla.org/en-US/firefox/addon/zutilo-utility-for-zotero/versions/1.1.16

    Again, the patch that I submitted for review should be cross-platform compliant. So once it is accepted and you starting saving attachments with relative paths, you should be fine.

    However, in some cases, it might hard to convert old absolute paths into new relative paths (eg if you have old Windows paths and you move everything to Linux, the patch won't be able to recognize those old paths as being on the base path). To help with this (and provide a workaround until the patch is accepted), I added the option to Zutilo's "modify attachments" function to replace parts of paths not at the beginning of the path.

    So now you should be able to convert Windows paths to Linux paths in two steps. For example, for the path "E:\path\to\attachment". You would first run modify attachments changing "\" to "/" and not restricting to the beginning of the path to get "E:/path/to/attachment". Then you would run "modify attachments" again changing "E:" to "/base" (and restricting to the beginning of the path) to get "/base/path/to/attachment".
  • Update: the relative linked file attachments patch has been merged into Zotero. It will be included in version 3.1 which will be released by early April when Firefox 20 is released.
  • Nice work, thanks @willshanks.
  • @Willshanks: I notice that the relative linked file attachments has been added to Zotero (I am on version 4.0.9.1). But the help file on this is still the old one. So no information on how exactly this works (of course I could get it by going carefully through the above thread, but...). Is there a place where this help file exists?
  • I have this written up here: http://zoteromusings.wordpress.com/2013/04/11/whats-new-in-zotero-4-0-part-2/ (about half way down)
    it's pretty brief, but should still be clear.

    Also, you should be on version 4.0.12
  • @Adam: thanks. But forgive me all if I have missed something somewhere:
    I thought this whole thread started with the question of whether a pdf sitting in some specific path on my computer (say E:\water\literature\xxxx.pdf) can be linked to its citation in Zotero without it being copied (and therefore duplicated) and placed in an opaquely named folder in Zotero's directory such as C:\Documents and Settings\USER\Application Data\Zotero\Zotero\Profiles\dvnit91j.default\zotero\storage\MF5Q2SJA. Note that Endnote allows this: one only has to un-check the box which says "copy this file to default folder..." when using Refs-File Attach command.
  • edited August 21, 2013
    sharachchandra, when you link a pdf file to a Zotero item as a linked file attachment, the pdf file on your computer is not moved. If you have a Base directory set for relative attachment paths in Zotero's preferences, Zotero will save the linked file attachment path as a relative path, but still the file itself is not moved.

    If you copy your Zotero data to another computer that has that file stored in a different location, but you set the Base directory properly on this other computer, the linked file attachment should still point to the file correctly.

    If you set your base directory to for example C:\folder1\folder2 and then link to the file, C:\folder1\folder2\folder3\file.pdf, internally Zotero saves the link as attachments:\\folder3\file.pdf (or something like that). Then when you ask Zotero to open that file, it replaces "attachments:\\" with whatever the current base directory setting is before looking for the file on your computer.
  • in addition to what willshanks says (linked files were always possible in Zotero, btw., so that part isn't new) since 4.0.10 you can also add linked files using
    Ctrl-Shift-drag on Windows/Linux, Cmd-Option-drag on OS X
  • Thanks guys. There is one caveat, however. Linked files are only possible in My Library, not in Group Libraries. Right?
  • There is some discussion about Group Libraries in this thread:

    https://forums.zotero.org/discussion/28694

    At some point in the future, Group Libraries will probably support relative attachment paths, but I don't know how high of a priority that is right now.
  • Because my C: drive on my PC is nearly full I had to migrate my Zotero linked drives to another drive on the same computer without breaking the links. I have exactly the same folder set up but they are now in my K: drive. Is there any straightforward way to restore the links. I am talking about thousands of files
  • You shouldn't need Zutilo for that, though. If you just set the Linked Attachment Base Directory to the root of the structure at the old location, Zotero will make all the linked attachments below it relative, and you can then set the base directory to the new location where the files are and the files will start working again. (It's possible you need to move the files back to the old location first, but I don't think so.)
  • Thanks for both your suggestions. I first used the Zutilo extension and it worked perfectly. So I didn't try the next suggestion.
Sign In or Register to comment.