Closed Bug 924168 Opened 12 years ago Closed 12 years ago

pdf.js saves PDF file with its download button → nulls at end, file is damaged

Categories

(Firefox :: PDF Viewer, defect)

24 Branch
x86_64
Linux
defect
Not set
major

Tracking

()

RESOLVED FIXED
Firefox 26

People

(Reporter: ccreekin, Unassigned)

References

()

Details

(Keywords: dataloss)

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release) Build ID: 20130911164256 Steps to reproduce: Go to http://pubs.vmware.com/vsphere-55/index.jsp Click PDF and E-book Product Documentation Click API and SDK Click [pdf] after VMCI Sockets Programming Guide In pdf.js, click Open With Different Viewer Actual results: Adobe Reader X says "There was an error opening this document. The file is damaged and could not be repaired." This is because the file is null-padded to the nearest 1024 (?) block after the PDF end of file. It seems to be an interaction between Tomcat server and Firefox. Expected results: Adobe Reader should display the file, as it does with Internet Explorer.
Confirmed with firefox-24.0.en-US.linux64 and 2013-10-07-03-02-03-mozilla-central-firefox-27.0a1.en-US.linux-x86_64. It only happens when I use PDF.js' download button, not Ctrl+S (and not wget). The "normal" file saved is 811427 bytes, the broken file saved is 1048576 bytes.
Severity: normal → major
Status: UNCONFIRMED → NEW
Component: Untriaged → PDF Viewer
Ever confirmed: true
Keywords: dataloss
Summary: After pdf.js save, nulls at end, file is damaged → pdf.js saves PDF file with its download button → nulls at end, file is damaged
Or maybe it is random and/or a server bug?
It happens consistently with Firefox 24.0, but rarely with Nightly. Tech Evangelism?
Status: NEW → UNCONFIRMED
Ever confirmed: false
OK, it is consistent enough in the old builds: WFM: 2013-01-04-03-08-23-mozilla-central-firefox-20.0a1.en-US.linux-x86_64 WFM: 2013-04-01-03-08-17-mozilla-central-firefox-22.0a1.en-US.linux-x86_64 WFM: 2013-04-08-03-09-28-mozilla-central-firefox-23.0a1.en-US.linux-x86_64 WFM: 2013-04-11-03-09-25-mozilla-central-firefox-23.0a1.en-US.linux-x86_64 WFM: 2013-04-12-03-08-28-mozilla-central-firefox-23.0a1.en-US.linux-x86_64 bug: 2013-04-13-03-09-27-mozilla-central-firefox-23.0a1.en-US.linux-x86_64 bug: 2013-04-16-03-09-01-mozilla-central-firefox-23.0a1.en-US.linux-x86_64 bug: 2013-05-03-03-09-20-mozilla-central-firefox-23.0a1.en-US.linux-x86_64 bug: 2013-06-01-03-09-38-mozilla-central-firefox-24.0a1.en-US.linux-x86_64 bug: 2013-08-11-03-02-25-mozilla-central-firefox-26.0a1.en-US.linux-x86_64 https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=7b8ed29c6bc0&tochange=24a6b5ed51e3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Now, I probably was confused by the renaming of the downloaded file because another file with that name existed. I got this by trying once with more recent builds: bug: 2013-09-12-03-02-01-mozilla-central-firefox-26.0a1.en-US.linux-x86_64 a4e9c9c9dbf9 WFM: 2013-09-13-03-02-01-mozilla-central-firefox-26.0a1.en-US.linux-x86_64 b9029b1de410 WFM: 2013-10-08-03-02-02-mozilla-central-firefox-27.0a1.en-US.linux-x86_64 So the bug was fixed in https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=a4e9c9c9dbf9&tochange=b9029b1de410 That includes a PDF.js update, which fixes a similar bug: bug 914603 comment #0: “#3634 Firefox: Corrupt downloads ("padded" downloads) when there is no content length”. https://github.com/mozilla/pdf.js/pull/3634 So let's assume it's https://github.com/mozilla/pdf.js/issues/3627 Apparently bug 908203 is the same thing; marking this one duplicate of it since that one is older.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
The reporter of bug 908203 disagrees that the bug is the same.
Resolution: DUPLICATE → FIXED
Target Milestone: --- → Firefox 26
You need to log in before you can comment on or make changes to this bug.