Unable to open downloaded pdf files ("Cannot display PDF (<filename> cannot be opened)")
Categories
(Firefox for Android Graveyard :: Download Manager, defect, P2)
Tracking
(firefox61 wontfix, firefox62 wontfix, firefox63 wontfix, firefox64 wontfix, firefox65 wontfix, firefox66 wontfix, firefox67 affected)
People
(Reporter: mlobontiuroman, Unassigned)
References
()
Details
(Whiteboard: [geckoview:p2])
Attachments
(4 files)
| Reporter | ||
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
| Reporter | ||
Comment 3•7 years ago
|
||
Comment 4•7 years ago
|
||
| Reporter | ||
Comment 6•7 years ago
|
||
| Reporter | ||
Comment 8•7 years ago
|
||
| Reporter | ||
Comment 10•7 years ago
|
||
Comment 11•7 years ago
|
||
| Reporter | ||
Updated•7 years ago
|
Comment 12•7 years ago
|
||
Updated•7 years ago
|
| Reporter | ||
Comment 18•7 years ago
|
||
Updated•7 years ago
|
Comment 20•6 years ago
|
||
Comment 21•6 years ago
|
||
I have a feeling I am experiencing the same issue and the bugs (https://bugzilla.mozilla.org/show_bug.cgi?id=889105 and https://bugzilla.mozilla.org/show_bug.cgi?id=902971) are also possibly related. I think the path to the file being passed to the applications is being encoded correctly/as expected by the programs trying to open them. I have had the problem numerous times with Foxit Pro and put it down to it, but I have had it in a new calendar app I have just downloaded.
I have put a screen capture on youtube (https://youtu.be/l8lfRAGwXeg) showing the issue and the errors from the calendar app (Simple Calendar App).
To reproduce:
- Goto https://www.meetup.com/london-nodejs/events/257269047/
- Click on the Add to Calendar link
- Select ICal
- Open the downloaded ics file from either the notification or the popup
- Try to import the event
Result. Import will error, either with a ENOTENT (from popup) or a ENOACCESS (from the notification)
Updated•6 years ago
|
Comment 22•6 years ago
|
||
The issue described in comment #9 is because the filename is not successfully extracted.
I see this first in HelperAppDialog.show [1] where aLauncher.suggestedFileName is dabs not dabs.pdf (although the mime type is correctly identified as application/pdf).
console.trace() does not want to go further and show the caller of this method so I don't know yet where this name is formed.
The file is persisted to disk with that filename (without an extension) and so Android cannot correctly infer the type of the file to know to open it with a pdf reader application.
Comment 23•6 years ago
|
||
(In reply to Jack from comment #21)
I have created bug 1523976 for this since it seems like a separate issue.
Comment 24•6 years ago
|
||
(In reply to Petru-Mugurel Lingurar[:petru] from comment #23)
Indeed. Thanks Petru.
Comment 25•6 years ago
|
||
NI-ing Chris to assess the priority and find a more suitable owner since the issue happens because of an improperly deduced "mSuggestedFileName" in native code [1] and is reproducible also
- on Focus (the file has .bin extension)
- on Reference Browser (the filename is
dabspdf(no dot before the extension); for other downloaded files the name seems to have the right structure)
// the filename for the pdf downloaded from https://www.skybriefing.com/portal/delegate/dabs?today should have been dabs.pdf
[1] https://searchfox.org/mozilla-central/source/uriloader/exthandler/nsExternalHelperAppService.cpp
Updated•6 years ago
|
Comment 26•6 years ago
|
||
I can reproduce this bug in Focus+WebView (dabs.bin), Focus+GeckoView (dabspdf), the Reference Browser (dabspdf), and Fennec (dabs), but not Chrome Android or Firefox desktop. I wonder why this bug affects both Focus+WebView and GeckoView.
I'll send this bug to GeckoView triage for review. I'm guessing this is not a core Gecko bug because Firefox desktop is not affected.
Updated•6 years ago
|
Comment 28•6 years ago
•
|
||
This can be reproduced on Desktop by setting PDF files to be automatically saved, which I think is also more similar to how downloads work on Android (although the code paths might still not be 100% identical).
Also note that on Desktop, the bug can be reproduced e.g. on Ubuntu, but not on Windows, because in addition to the file name (which ends up as dabs) we're also providing an extension to Windows's "Save as..." dialogue, which then fixes up the file name to include an extension by itself.
Comment 29•6 years ago
|
||
Although on second thought, while those problems are definitively related, I'm not sure how easily it would be to actually fix desktop and Android together in one go. So maybe this should be un-duped after all?
Comment 30•6 years ago
|
||
In that case, let's reopen this bug. Given that Focus+GeckoView and Fennec have different bad results ("dabspdf" vs "dabs" in comment 4), this bug might need to be fixed separately for GeckoView, Fennec, and desktop.
Updated•6 years ago
|
Comment 31•5 years ago
|
||
Brilliant, thanks for sharing this info. This is all very interesting 🙂 mygroundbiz
Comment 32•4 years ago
|
||
Updated•4 years ago
|
Description
•