From c16432b217b2732182f2363bbd936ebf937cb5b0 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 8 Mar 2021 08:58:26 -0500 Subject: [PATCH] Mendeley import: Set contentType for PDFs --- chrome/content/zotero/import/mendeley/mendeleyImport.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/chrome/content/zotero/import/mendeley/mendeleyImport.js b/chrome/content/zotero/import/mendeley/mendeleyImport.js index 5f6a0ffb4e..e0324c5c47 100644 --- a/chrome/content/zotero/import/mendeley/mendeleyImport.js +++ b/chrome/content/zotero/import/mendeley/mendeleyImport.js @@ -136,6 +136,15 @@ Zotero_Import_Mendeley.prototype.translate = async function (options = {}) { } } + // Set content type for PDFs + if (docFiles) { + docFiles.forEach((file) => { + if (file.fileURL.endsWith('.pdf')) { + file.contentType = 'application/pdf'; + } + }); + } + // Save each document with its attributes let itemJSON = await this._documentToAPIJSON( map,