Saving local webpage via connector

Hello everyone,

Sorry for the novice question. I've created an .html file locally (make using Bookdown in R) and I want to save it to Zotero. The file has an audio and a video clip embedded into it, so simply dragging the file into Zotero does not seem to work.

When trying to run the connector in Firefox on a local file, nothing happens.

Is there any way of saving a .html file to Zotero from local storage together with any supporting media?

Please help. Thanks very much
  • Browsers don't allow the connector to work on file:// URLs.

    When you say the audio and video are embedded, what do you mean? If the files are in the same directory as the original HTML file, you can just copy those files into the storage directory of the HTML file you added. Right-click on the attachment, select Show File, and then copy the files into that folder.

    All Zotero does to display an HTML file is open it in your default browser at its file:// URL, so it will work exactly the same way as when the file is elsewhere on your disk. The only exception is if the files are in a subfolder, in which case you'd have to move them into the same folder and update the references in the file to not include a folder.
  • Thanks dstillman!

    Yes, by embedded I mean that there are audio + video files in the same directory as the .html file. Copying them into the storage folder of the .html works great for the computer I am working on, so thanks so much for that!

    However, the challenge now becomes, how do I make the .html work when viewed from online? I.e. what URL should be used in the .html files to call the audio and video files?

    Is that even possible?

    Thanks again!
  • Do you mean when viewing the HTML file on the zotero.org web library?
  • Zotero will upload the whole directory and it’ll just work, but if the file is already uploaded before you copy the additional files, you’ll need to make a change to the main HTML file to retrigger uploading.
  • @bwiernik yep, trying to make the .HTML viewable from zotero.org

    @dstillman I'm sorry i don't follow. Right now this is my workflow, and it does not work:

    - Drag the .HTML file into Zotero.
    - Create parent item and make it type "webpage"
    - Open storage of item, and copy image/audio/video files into folder.
    - When viewed from my local computer, .HTML works fine.
    - When viewed from zotero.org (online) the .HTML file can't find the additional files.

    What do I need to do differently?

    Sorry for being obtuse, and thanks so much!
  • edited December 24, 2018
    If Zotero syncs before you copy the additional files to that directory, it won’t detect further changes to the storage directory outside the main file. So if you add other files, you need to open the HTML file in a text editor and make some change — just adding an extra space somewhere would do — so that Zotero detects that the file has changed and reuploads it with the additional files. A future version might be able to check other files in the directory for changes, but that’s not possible now for technical reasons, so only the main file is tracked.

    Alternatively, you can temporarily disable auto-sync before adding the HTML file and the other files, so that the initial upload includes those files.
  • @dstillman seems to work great!

    I need to test it a bit more vigorously (different files, mobile etc.), but right now it seems like it works great.

    Thanks!
Sign In or Register to comment.