0

I have searched and searched for a solution to this problem, please help. I am using a Samsung Galaxy S4 with Android 4.2.2 along with the Chrome browser.

Steps to replicate:

  1. Navigate to: http://www.buzzbuzzbingo.com/Holidays/Halloween_Images/
  2. Click "Download and Print" to start download of PDF file.
  3. Notice notification that says "Starting downloading..."
  4. Open notification bar and see that the download has completed.
  5. Click the downloaded PDF file and receive "Cannot open file" error message and the notification bar closes.

Long clicking the downloaded PDF does not offer options for choosing which app to open the file. I have installed Adobe Reader and using that to navigate to the downloaded file will open the file just fine. Same with Polaris Office. I would like to be able to open the PDF from the notification bar. Alternatively if I could view the PDF directly in Chrome, that would be acceptable.

1 Answer 1

2

It's a combination of a PDF and a browser issue. Some PDFs work fine while others do not across different browsers.

Downloading the PDF you mentioned, here are the results using different browsers:

  • Chrome: Cannot open PDF from notification
  • Boat Browser: Cannot open PDF from notification
  • Dolphin: Can open PDF from notification

Downloading a different PDF from another site, here are the results using different browsers:

  • Chrome: Can open PDF from notification
  • Boat Browser: Can open PDF from notification
  • Dolphin: Can open PDF from notification

UPDATE 2013-10-11: According to Scott's findings, this is a PDF issue. The Content-Type header of the problematic PDF is application/x-download, while the working PDF is application/pdf.

If you control the server which is serving these PDFs, you can switch the Content-Type header to allow it to open in all browsers. PHP example:

In PHP this was previously broken when sending:

 header('Content-Type: application/x-download');

Switch this to this header to work:

 header('Content-Type: application/pdf');
5
  • I can say that the PDF is created using a PHP library called FPDF. Thank you for this info, I'll have to compare the file headers next. Which site did you compare it to?
    – Scott
    Oct 10, 2013 at 17:45
  • 1
    @Scott Downloaded the PDF in pinoyfitness.com/2013/10/…
    – geffchang
    Oct 10, 2013 at 17:58
  • Looks like a PDF issue. The difference is that the Content-Type header is application/x-download on the PDF download that causes the error and application/pdf on the PDF download that works.
    – Scott
    Oct 10, 2013 at 21:04
  • 1
    @Scott Added your comment to the answer. :)
    – geffchang
    Oct 11, 2013 at 3:17
  • 1
    Strictly speaking, that's a server issue, not a PDF issue. The file itself is fine, the server is just reporting its type wrong. It seems that Dolphin isn't saving the reported file type when it downloads the file.
    – Dan Hulme
    Oct 11, 2013 at 16:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .