Fix in-client SingleFile saving on Windows

https://forums.zotero.org/discussion/85538/zotero-5-0-91-beta-not-saving-snapshots-d672469174
This commit is contained in:
Dan Stillman 2020-10-08 18:44:50 -04:00
parent 71550deb98
commit 479f01fa9c

View file

@ -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);