Closed Bug 115440 Opened 22 years ago Closed 22 years ago

File/Save Page as doesn't work for PDF Files [also text, movie, image bugs]


(Core Graveyard :: File Handling, defect, P2)



(Not tracked)



(Reporter: Biesinger, Assigned: bugs)





(1 file, 4 obsolete files)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6+) Gecko/20011213
BuildID:    2001121417, self-compiled

When a PDF File is displayed using the Adobe Acrobat PDF plugin (,
File|Save Page As doesn't do anything (at least the filepicker doesn't appear).

Reproducible: Always
Steps to Reproduce:
1. Visit the above URL with installed
2. Click File/Save Page As

Actual Results:  Nothing

Expected Results:  Filepicker shows up and on clicking OK the file is saved.

I get the following message in JS Console:
Error: aDocument has no properties
Source File: chrome://communicator/content/contentAreaUtils.js
Line: 284
La dee dee.

Over to Ben.
Assignee: pchen → ben
Severity: minor → normal
Component: XP Apps → File Handling
OS: Linux → All
Hardware: PC → All
yikes. ok, saving a document when there is none. easy. will just call saveURL
instead in this case. patch soon. 
Ben, could we just do saveURL for _all_ non-html content?

That would also fix the issues with saving plaintext and images incorrectly...
Attached patch patch to fix (obsolete) — Splinter Review
removes duplication of code & creates single 'saveInternal' method that always
sniffs for content-type. This ensures that 'savePage' on a image document or
pdf file will save as the right type rather than trying to save as text/html.
Also removes the not-hooked-up-yet Text only filter.
fix checked in.
Closed: 22 years ago
Resolution: --- → FIXED
Ben, did this (should this) make it into the 0.9.7 branch?
a=asa (on behalf of drivers) for checkin to 0.9.7 (hoping it will make 115132
Keywords: mozilla0.9.7+
Blocks: 114455
Checked into the 0.9.7 branch.

No longer blocks: 114455
Still does not work in a recent CVS build from some hours ago (linux)

Resolution: FIXED → ---
Priority: -- → P2
Target Milestone: --- → mozilla0.9.8
Attached patch actually fix (obsolete) — Splinter Review
acquire location to save from root content view if document does not exist. 

(mixed in with some other changes)
Attachment #62000 - Attachment is obsolete: true
*** Bug 115395 has been marked as a duplicate of this bug. ***
*** Bug 115210 has been marked as a duplicate of this bug. ***
*** Bug 115087 has been marked as a duplicate of this bug. ***
Comment on attachment 64031 [details] [diff] [review]
actually fix

Attachment #64031 - Flags: review+
nsIPref is deprecated; we should be using nsIPrefService/nsIPrefBranch instead.
Can I get r/sr on this new patch?
Keywords: patch, review
updating summary to remind me to verify for the cases in the dups of this bug.
Summary: File/Save Page as doesn't work for PDF Files → File/Save Page as doesn't work for PDF Files [also text, movie, image bugs]
Ben, I think the getBranch("") call should ask for "", or, the
getComplexValue("dir") should use "".

If you change the getBranch, then don't you need to change all the other users
of that branch to drop the "" prefix?
oops, that's a typo. I changed the getComplexValue call to call

Comment on attachment 64199 [details] [diff] [review]
patch that uses nsIPrefService/nsIPrefBranch


with the fix described in the bug comments
Attachment #64199 - Flags: review+
Attachment #64199 - Attachment is obsolete: true
Comment on attachment 64925 [details] [diff] [review]
er, the right patch this time

Noting law's r= and adding

Attachment #64925 - Flags: superreview+
Attachment #64925 - Flags: review+
fix checked in
Closed: 22 years ago22 years ago
Resolution: --- → FIXED
okay, using 2002.01.24.0x comm bits i've tested the following scenarios, where
save page works. what i did was

1. load a given file
2. selected File > Save Page As [accepted whatever filetype was listed]
3. downloaded it
4. reopen it in browser to make sure the browser actually saved the file sensibly

scenarios that passed:

* linux rh7.2: text file, shockwave flash file

* win2k: text, pdf, flash

* mac os 10.1.2: text, quicktime, flash
* mac os 9.2: pdf

Christian, could you verify pdf on linux, pls? thx a lot!
Verified that PDF can be saved on linux, current CVS trunk build.
verified on linux, cvs build 2002012422, using steps described by sairuh.
pdf from the url field is correctly saved.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.