Prevent copied PDF files being read-only

When I store PDF files by dragging/dropping onto Zotero records, the resulting files are read-only (or at least some of them are), preventing me from making annotations. My work around is to periodically make the entire contents of the 'storage' folder writeable but it would be ideal if the files were stored writeable in the first place.
  • I've never noticed Zotero making anything read-only. I regularly drag and drop PDFs on entries as attachments.
  • After further investigation, I think I was mistaken. It seems the files were already read-only before being copied. It would be nice if Zotero could strip these of the read-only attribute automatically though, since that was just how they were downloaded.
  • I don't think it should be zotero's job to set file permissions for you. Fix your umask.
  • According to my research, 'umask' is not a property that applies to the Windows operating systems so fixing it on my computer is not an option. Since Zotero is taking a copy of the PDF, it's surely much more useful to have it write-enabled.
  • edited September 29, 2009
    yes, but it's not an attribute that Zotero sets. It's something that somehow your windows security settings do, so you should look for a way to fix it in windows (which is what noksagt meant with umask). Something like this may help:
    http://www.astahost.com/info.php/Windows-Umask-Option_t13891.html

    Zotero just saves the file. Your OS tells you that it's read only.
  • edited September 13, 2011
    I agree, Zotero shouldn't be expected to touch file permissions. Also, I've never had Zotero download PDFs automatically that turned out to be read-only.
  • I have been annoyed by the same issue. Here is a (perhaps inelegant but usefull) workaround (zotero 2.1.10).

    modify chrome/content/zotero/xpcom/attachments.js (in zotero.jar of the Firefox profile extensions) :


    // AFTER EXISTING (around line 86, function importFromFile)
    // Point to copied file
    var newFile = destDir.clone();
    newFile.append(newName);

    // ADD NEW LINE
    newFile.permissions = 0777;
  • That is a bad fix. If file permissions are being set incorrectly, it's a problem on your system, not in Zotero.
  • edited September 15, 2011
    But unfortunately this is a windows system I have to cope with... And I am importing a whole database (~12500 file attachements) into zotero.

    If only I could have run "chmod" recursively through the folder tree it would have been solved a long time ago!

    So I suppose the trick can be usefull in specific cases.
  • You can install cygwin and then run a recursive chmod from there.
  • By the way, in order to share the stored files with other users, I have also changed the Zotero.getStorageDirectory() to point to a network directory instead of local zotero directory.

    I plan to sync only zotero.sqlite beetween users with the built-in option.

    The goal is to get a multi-computer database without duplicate files and without messing with files and folders.

    Do you see any reason for this to fail?

    Best regards
  • Consider the following:
    -what happens when someone decides to rename a file using Zotero
    -are the folder names inside Zotero data directory guaranteed to be globally unique so that there are no possible for conflicting folder names between two local libraries
    -how do you handle conflicts when two users edit the same file

    I would go with the buit-in file sync instead.
  • -what happens when someone decides to rename a file using Zotero

    I believe that happens:
    1) the file is renamed
    2) the change is registered into zotero.sqlite
    3) zotero.sqlite is synchronized
    4) for every user the attachement point to the renamed file

    -are the folder names inside Zotero data directory guaranteed to be globally unique so that there are no possible for conflicting folder names between two local libraries

    The risk is that at the same time to users add a new attached file AND the same folder name (random key) is required? It seems extremely unilkely...

    -how do you handle conflicts when two users edit the same file

    Our database is mainly pdf with a few xls, doc, txt and artwork. I suppose Excel and Word would pop up with a readonly warning, and any text editor would ask if one wants to reload the changed file.

    I would go with the buit-in file sync instead.

    The problem is, our file database weights more than 20GB. So I don't believe file sync is an option.

    ... Am I wrong?

    Thank for your help.
  • Our database is somewhere between 5-10GB and there is no problem with that. You can just take the 25GB subscription and try that. I am fairly sure that there will be no problems and also that the Zotero people will refund your purchase if for some reason Zotero would not be able to handle the 20GB database.
  • edited September 15, 2011
    Anyway, some data is classified, so we don't want to store our files on any third-part server for security issues.
  • You can still use WebDAV with file syncing, if you use a shared personal database (that is, not a group library).
Sign In or Register to comment.