From 479f01fa9cd19b8ba129813243971879bd6febe9 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 8 Oct 2020 18:44:50 -0400 Subject: [PATCH] Fix in-client SingleFile saving on Windows https://forums.zotero.org/discussion/85538/zotero-5-0-91-beta-not-saving-snapshots-d672469174 --- chrome/content/zotero/xpcom/utilities_internal.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/chrome/content/zotero/xpcom/utilities_internal.js b/chrome/content/zotero/xpcom/utilities_internal.js index ab2d23740b..0e9a79296a 100644 --- a/chrome/content/zotero/xpcom/utilities_internal.js +++ b/chrome/content/zotero/xpcom/utilities_internal.js @@ -809,6 +809,10 @@ Zotero.Utilities.Internal = { */ _saveSingleFileResource: async (resource, tmpDirectory, fileName, binary) => { Zotero.debug('Saving resource: ' + fileName); + + // Fix slashes on Windows + fileName = OS.Path.join(...fileName.split('/')); + // This seems weird, but it is because SingleFileZ gives us path filenames // (e.g. images/0.png). We want to know if the directory 'images' exists. let filePath = OS.Path.join(tmpDirectory, fileName);