parent
7b26dab2f2
commit
17daf9fe8d
1 changed files with 5 additions and 3 deletions
|
@ -4708,11 +4708,13 @@ var ZoteroPane = new function()
|
||||||
if(typeof itemIDs != "object") itemIDs = [itemIDs];
|
if(typeof itemIDs != "object") itemIDs = [itemIDs];
|
||||||
|
|
||||||
var launchFile = async (path, contentType, itemID) => {
|
var launchFile = async (path, contentType, itemID) => {
|
||||||
// Fix blank PDF attachment MIME type
|
// Fix blank PDF MIME type and incorrect EPUB MIME type
|
||||||
if (!contentType) {
|
if (!contentType || contentType === 'application/epub') {
|
||||||
let item = await Zotero.Items.getAsync(itemID);
|
let item = await Zotero.Items.getAsync(itemID);
|
||||||
let path = await item.getFilePathAsync();
|
let path = await item.getFilePathAsync();
|
||||||
let type = 'application/pdf';
|
let type = contentType === 'application/epub'
|
||||||
|
? 'application/epub+zip'
|
||||||
|
: 'application/pdf';
|
||||||
if (Zotero.MIME.sniffForMIMEType(await Zotero.File.getSample(path)) == type) {
|
if (Zotero.MIME.sniffForMIMEType(await Zotero.File.getSample(path)) == type) {
|
||||||
contentType = type;
|
contentType = type;
|
||||||
item.attachmentContentType = type;
|
item.attachmentContentType = type;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue