firefox-ios
firefox-ios copied to clipboard
Download pdf corrupts file
Steps to reproduce
Share previewed pdf with another iOS app
Expected behavior
Other app gets pdf and opens it successfully
Actual behavior
Other app reports corrupted pdf, 16kb file size. Same result in two different pdf apps receiving the file (Xodo & pdf Expert)
Device & build information
- Device: iPad Pro
- Build version: ?
Notes
This workflow is successful with the safari browser
┆Issue is synchronized with this Jira Task
I have the same issue! When I want to share the pdf with other app or print it, I always get a 182 bytes file and there is nothing in the file. But when I use other app like safari or edge, everything is ok. My device is ipad air5 and the version of firefox is 104.2.
However, when I try to share the pdf in http://www.pdf995.com/samples/pdf.pdf, it works. I thought this bug may happen in some websites which dynamically load the pdf.
Most likely you are trying to download a file from a website which requires a login or cookies. In that case, it is likely a duplicate of #9010.
➤ Nishant Bhasin commented:
Mini-Investigation Notes
Instead of redownloading the PDF, look into why the[ Tab’s temporary document |https://github.com/mozilla-mobile/firefox-ios/blob/main/Client/TabManagement/Tab.swift#L303]contains and share the data with the respective application.
- Make sure the temporary document ( https://github.com/mozilla-mobile/firefox-ios/blob/main/Client/Frontend/Browser/TemporaryDocument.swift )t is not nil
- If the temporary document ( https://github.com/mozilla-mobile/firefox-ios/blob/main/Client/Frontend/Browser/TemporaryDocument.swift ) in tab is not nil then check what and how items are being shared in presentShareSheet ( https://github.com/mozilla-mobile/firefox-ios/blob/main/Client/Frontend/Browser/BrowserViewController.swift#L1533 )
This is just one approach as we can’t really re-download the pdf file but should share what we already have in form of temporary document.
Maybe related to https://github.com/mozilla-mobile/firefox-ios/issues/14053.