Skip to content

PDF Downloader downloads HTML source code instead if no access #7452

@Krzmbrzl

Description

@Krzmbrzl

JabRef 5.2--2020-12-24--6a2a512
Linux 5.4.0-59-generic amd64
Java 15.0.1

Steps to reproduce the behavior:

  1. Import an entry via Browser extension for which one does not have acces rights for the PDF (e.g. https://onlinelibrary.wiley.com/doi/abs/10.1002/0470862106.ia615)
  2. JabRef automatically downloads the PDF (or rather it tries to do so)
  3. Instead of the PDF it downloads the HTML webpage that would pop up if I was to try to download the paper manually. Thus my "PDF" now only contains HTML source code

I have encountered this a few times by now and in all cases the downloaded "PDF" was a plain text file containg the HTML source code.
My suggestion for a mitigation would be to check the downloaded file and if it starts with plain text <!DOCTYPE html>, then assume the download has failed and remove the "PDF" again (restoring the file link with the download URL in JabRef).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions