My PDFs were replaced by HTML files

Report ID: 223668007
I have a library of hundreds of pdfs. However, now when I try to open a pdf in Zotero I get the following message:

"The attached file could not be found.
It may have been moved or deleted outside of Zotero, or, if the file was added on another computer, it may not yet have been synced to or from zotero.org."

I have not used zotero with another computer, nor have I synced it online or used it online. I have stored all my files locally on my hard drive at C:\Users\User\Zotero. The data directory location is set to the default location, which is this location. When I go there, I do have a storage folder that is about 600mbs. When I search in that folder using key words from my pdfs I do find folders with documents in them. However, what I find are not the pdfs that I originally had. They seem to have been replaced by html files with all the accompanying jpgs, svgs, etc. When I open the html file, it takes me to the website where my pdf came from. However, my pdf is simply gone. I don't want the html files. I want my pdfs back. They had tons of notes and highlights. That was two years of my PhD work, so it is really important that this gets fixed.
  • edited August 18, 2018
    Zotero has no function to convert pdfs to webpages. It does have the ability to take snapshots of webpages (in addition to downloading pdfs). Could you be looking at these snapshots? Are there any pdfs in the storage folder?

    Have you used zotfile or other extensions to change your pdf directory?

    Might some program (such as whatever you're using to markup the pdfs) done something with the pdfs?


  • The PDFs weren't replaced — the files you're finding are just separate webpage snapshots, which also get attached to items.

    Zotero certainly did not delete the files on disk — it literally has no code to do so without also deleting the attachment — so either the files still exist somewhere or something else deleted them.

    Are the PDFs you're trying to open stored files or linked file? For the latter, you would see a small chain in the attachment icon. You've posted about ZotFile before, suggesting you were actually using linked files, in which case your PDFs wouldn't have been within the data directory and you might simply have moved the directory where they're stored. To fix that, you'd want to move them back to where Zotero is looking, set up a Linked Attachment Base Directory in the Advanced → Files and Folders pane of the Zotero preferences, move the directory, and then update the base directory.

    Can you provide a Debug ID (different from a Report ID) for an attempt to open a file that's missing?
  • Thank you! I am relieved. Yes, what you say here sounds like what is happening. Here is a debug ID: D522605568. I have used ZotFile. I can see now on add-ons that ZotFile is incompatible with 5.0.55. So, it appears my real question is this: Is there any documentation that helps ZotFile users to move to 5.0.55, showing them how to find and move the directory?

    Above, dstillman says, "move them back to where Zotero is looking, set up a Linked Attachment Base Directory in the Advanced → Files and Folders pane of the Zotero preferences, move the directory, and then update the base directory."

    I think I will need more details for this to work. First I don't know how to find the location of the files (I don't know where Zotfile put them and can't find it with Zotfile disabled). Then, do I move the individual files or all at once? How do I know where Zotero is looking beyond the generic "storage" folder? Etc. Etc.

    I appreciate help with this. It will also likely help others that were using Zotfile and now can no longer access their files.
  • I think I will need more details for this to work. First I don't know how to find the location of the files (I don't know where Zotfile put them and can't find it with Zotfile disabled). Then, do I move the individual files or all at once? How do I know where Zotero is looking beyond the generic "storage" folder? Etc. Etc.
    Have a look at the Zutilo add-on, which can show you the current path Zotero is looking and also batch-change those paths.
    https://github.com/willsALMANJ/Zutilo
  • adamsmith, I added Zutilo to Zotero stand alone (I am not using Firefox). I was able to find the location of my attachments by right clicking on items > Zutilo > Show Attachment Paths. Now I need to do the batch change or follow dstillman's instructions: "set up a Linked Attachment Base Directory in the Advanced → Files and Folders pane of the Zotero preferences, move the directory, and then update the base directory."
    I'm not sure how to do either of those things. Any further detail would be appreciated!
  • Can you post the path where the files actually are, where Zotero is looking, and what, if anything, is in the base directory field currently?
    You can xxx out your username in these filepaths if you prefer.
  • The base directory field (data directory location in preferences) is set to the default, C:\Users\User\Zotero. The path where the files actually are is: C:\Users\User\Documents\xxxxxxxx\Pro\xxxxxxxx\Research\ZOT\
  • The Linked Attachment Base Directory and the Data Directory are separate things.
  • We'd also need what Zutilo shows you when you use Show Attachment path.
  • adamsmith, here is one file's path when I use "Show Attachment Path": C:\Users\User\Documents\xxxxxxxx\Pro\xxxxxxxx\Research\ZOT\Journal of the International Phonetic Association2015\Chirkova et al. - 2015 - Ersu.pdf. That is the path for the pdf. However, there is also a "Snapshot" and that location is listed as "storage:C91C8AD692A11052A92B6C9FB4267F72.html". The actual path of that is C:\Users\User\Zotero\storage\JJMBDGXZ\C91C8AD692A11052A92B6C9FB4267F72.html.

    In Preferences > Files and Folders, both "Linked Attachment Base Directory" and "Data Directory Location" point to C:\Users\User\Zotero. So, most pdfs are in one location (C:\Users\User\Documents\xxxxxxxx\Pro\xxxxxxxx\Research\ZOT\) and the other things are in another location (C:\Users\User\Zotero\storage\).

    So, now I need to know how to relink the files or move the files to the correct location. I have looked at forum discussions such as "Batching editing selected file links with Zutilo", but I still don't feel confident doing it. The directions I have seen so far are not clear. Is there clear documentation somewhere that will help to do this? I'm sure that I am not the only one who was using Zotfile and will need to do this now that Zotfile is not longer supported.
  • So there's a lot of confusion here. For a start,
    1) ZotFile still works and is supported, not sure why you think that's not the case
    2) You should absolutely not have the base directory set to the same location as the data directory.

    The first thing I'd try is to set the relative base directory to
    C:\Users\User\Documents\xxxxxxxx\Pro\xxxxxxxx\Research\ZOT

    and see if that's enough to get your PDFs opening again.
  • adamsmith, when I go to add-ons in Zotero it says "ZotFile is incompatible with Zotero 5.0.55". That made me think ZotFile is no longer supported. However, after looking into it, I can see that ZotFile just needed to be updated. So I did that. ZotFile is now working. However, that alone did not get the files working.

    Under Zotero > Edit > Preferences > Files and Folders, under Linked Attachment Base Directory, I changed the Base Directory to the path you suggested above. It is still not finding the files.

    I have, however, when going through that figured out the issue that was keeping me from opening the files. I had changed one of the folder names in the path where ZotFile had stored the files. So, the old path no longer existed. I changed the folder name back to what it previously was and now it works.

    So, this brings me to one final question (hopefully). Thank you for your patience thus far! I do need to change the folder name where my files are located so that I can run programs that don't like spaces in path names. To do so and have my files still attached, can I do this:
    1. Rename the folder.
    2. Change the path in ZotFile preferences under "Location of files" to have the new folder name in it.
    3. Select all files in Zotero > right click > manage attachments > rename attachments.
  • edited August 20, 2018
    No, don't use Rename Attachments. This is all handled by Zotero's built-in functionality. If you want to change where your files are stored, you just need to update the base directory setting so that the relative paths it has stored still work. So if you had …/Research/ZOT/a/b.pdf and you set ZOT as the base directory, a relative path would be 'a/b.pdf', and if you renamed ZOT to ZOT2 and updated the base directory setting to point to ZOT2, the relative path would still work.

    You can then also update ZotFile settings so it moves files to the right place, but that's totally unrelated to your existing files.
  • dstillman, when I try this it does not work. I went to Zotero > Edit > Preferences > Files and Folders, under Linked Attachment Base Directory, I changed the Base Directory to the path with the new folder name. When I try to open a pdf, it cannot find the location.

    If I right click on items > Zutilo > Show Attachment Paths, I can see that the path is still pointing to the old path with the old folder name. I'm guessing this is because I used ZotFile to store the files in the custom location. Perhaps these are not relative paths but are absolute? Or perhaps, there is something I am missing?
  • Yes, the path needs to be stored as a relative path before you change the base directory for this to work. I don't know if ZotFile's moving prevents those files from being stored as relative paths — I wouldn't think so, since many people use both ZotFile and relative paths, but it's possible something isn't working. It should be easy enough to test with ZotFile and Zutilo once you've resolved this. You can forget about ZotFile for the moment.

    If you're able to temporarily move the folder back to the previous location, you can set the base directory back to that directory to collect those files as relative paths, and then you can move the folder to the new location and update the setting again.
  • dstillman, thank you, I was able to get that to work. In my previous workflow, when I would attach pdfs, I would do "Rename file from parent metadata". Perhaps that moved the files to absolute paths. If I do not do that and check the path using Zutilo > show attachment paths, it is a relative path. So, it seems that I do not need to do that at this point as my base directory is pointing to the location where I want my files to be. So, new files are already saved to that location and they are saved with a relative path, making it easy for me to move them if I need to.
Sign In or Register to comment.