Opened 10 years ago

Closed 10 years ago

Last modified 9 years ago

#460 closed enhancement (fixed)

importFromURL fails when importing PDFs from servers that do not properly support HEAD requests

Reported by: simon Owned by: dstillman
Priority: major Milestone: 1.0 Beta 4
Component: data layer Version: 1.0
Keywords: Cc:

Description (last modified by simon)

PDF downloads from Oxford Journals currently download the PDF to the desktop instead of attaching it to an item (at least on my Mac), because Oxford Journals returns an improper HTTP HEAD response:

HEAD /cgi/reprint/19/6/635.pdf HTTP/1.0
Host: her.oxfordjournals.org

HTTP/1.1 200 OK
Date: Tue, 19 Dec 2006 23:55:17 GMT
Server: Apache/1.3.26 (Unix) DAV/1.0.3 ApacheJServ/1.1.2
Content-Length: 0
Last-Modified: Fri, 12 Nov 2004 22:22:50 GMT
Connection: close
Content-Type: text/html

Is there anything we can do about this?

Change History (3)

comment:1 Changed 10 years ago by simon

  • Description modified (diff)

comment:2 Changed 10 years ago by dstillman

  • Resolution set to fixed
  • Status changed from new to closed

(In [1011]) Fixes #460, importFromURL fails when importing PDFs from servers that do not properly support HEAD requests

Override MIME type to application/pdf if extension is .pdf -- not all that robust, but it should work for most sites

comment:3 Changed 9 years ago by dstillman

(In [1710]) Fixes #766, Zotero saves text/html URLs with .pdf extensions as PDFs
Addresses #460, importFromURL fails when importing PDFs from servers that do not properly support HEAD requests

Now inspects supposed PDFs after download and deletes if not actually PDF format

Also:

  • Fixed bug when running importFromDocument() on a PDF on Windows that would result in an incomplete or missing (since r1688) attachment item
  • importFromDocument() no longer returns an itemID, since it can be partly asynchronous now
  • Added rudimentary 'text/html' support for Zotero.MIME.sniffForMIMEType()
Note: See TracTickets for help on using tickets.