5

Whenever I tap the export PDF button on the careers page, the generated PDF only has my name in it. I was on my phone, but I was not using the mobile site. The PDF preview looked fine, but the downloaded one was incomplete. I tried twice, a few hours apart. It is generated correctly when I use my desktop.

To make sure that it was a problem in the PDF itself and not the viewer on my phone, I e-mailed it to someone who also just saw my name.

Details:

Phone: LG Optimus G (Sprint version)
Android: 4.1.2
Browser: default (not Chrome)

1 Answer 1

0

The reason for this is that the Android browser does not download files directly from a HTTP POST request. The way it handles downloads is:

  1. The browser sends the request (HTTP POST in this case).
  2. The browser then detects that the response should be downloaded as a file, most likely via the Content-Disposition: attachment header.
  3. The browser then sends the URL for the download over to the download manager, which is a separate application. At this point all the POST data (which we use to generate the PDF) is lost.
  4. The download manager initiates a HTTP GET request to download the file. Since there is no POST data (which tells us which portions of the document to generate), the resulting file contains only the user's name.

This is a known issue with the Android browser/download manager.

To fix this we basically just store the identifier for the generated document, and if a subsequent GET request arrives from the same user for the same URL, we just send the previously generated document.

You must log in to answer this question.

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