Problem attaching PDF using Artwork Type

29 views
Skip to first unread message

John Justin

unread,
Mar 9, 2015, 1:52:45 PM3/9/15
to zoter...@googlegroups.com
Hello,  I can't seem to attach a PDF or any URL to the artwork type.

I'm using this statement in my translator:

artItem.attachments.push({
        title: "Artstor Image Viewer",
        mimeType:"application/pdf",
        url:ivURL
    });

where artItem is the Zotero artwork type object, and ivURL is a variable with the fully qualified URL to the file.

When I click the icon in the address bar, I get the entire citation into Zotero correctly. I also get a popup with a red X in it and the title "Artstor Image Viewer". I don't get the attachments under the citation.

In Scaffold, I see the correct object being created for the attachment using Zotero.debug.

I've looked through dozens of translators using Scaffold, I don't see any that use the artwork type so I am concerned that this type may not be fully functional.

The rest of my translator works fine.

I have other documents that I want to attach as well.

Any help would be appreciated.

Best,
John Justin
Director of Development
Artstor, Inc.




Aurimas Vinckevicius

unread,
Mar 9, 2015, 1:54:47 PM3/9/15
to zoter...@googlegroups.com
Are you actually trying to attach a PDF or an image? Zotero checks the MIME type to make sure the downloaded resource matches what's specified and will reject attachments that don't match.

--
You received this message because you are subscribed to the Google Groups "zotero-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to zotero-dev+...@googlegroups.com.
To post to this group, send email to zoter...@googlegroups.com.
Visit this group at http://groups.google.com/group/zotero-dev.
For more options, visit https://groups.google.com/d/optout.

Charles Zeng

unread,
May 28, 2015, 3:50:03 PM5/28/15
to zoter...@googlegroups.com
How does it check that the download resource matches the MINE type? Does it look into the resource file data bit/header, or just check for the file suffix?

Dan Stillman

unread,
May 28, 2015, 3:58:57 PM5/28/15
to zoter...@googlegroups.com
On 5/28/15 3:50 PM, Charles Zeng wrote:
How does it check that the download resource matches the MINE type? Does it look into the resource file data bit/header, or just check for the file suffix?

It checks the beginning of the file for the PDF magic number. Note that this only applies to PDFs, where login HTML pages are served in place of the actual files with some regularity.
Reply all
Reply to author
Forward
0 new messages