duckduckgo / Android

DuckDuckGo Android App
https://play.google.com/store/apps/details?id=com.duckduckgo.mobile.android
Apache License 2.0
3.76k stars 888 forks source link

[Bug] PDF downloads are corrupt/not accessible #3028

Open rmsgreig83 opened 1 year ago

rmsgreig83 commented 1 year ago

Describe the bug

https://www.nationalphotonic.com/product/datasheet-asys-dbell-110/ When you download from this website through duckduckgo on android the pdf will not open, if you add them to dropbox it says they are corrupt/unsupported. The downloads work on other browsers on android (chrome) and work on desktop on duckduckgo/chrome/firefox any ideas how to fix this? many thanks

How to Reproduce

Go to '...' Click on 'Download Now' Open file See error

Expected behavior

file should open as normal pdf

Environment

- DDG App Version: 5.154.0
- Device: Samsung Galaxy Tab A
- OS: Android
dryaz commented 1 year ago

Provided example tries to download

url: https://www.nationalphotonic.com/product/datasheet-asys-dbell-110/
contentDisposition: inline; filename="ASYS-dBELL-110-230321-Mod-230405-compressed-hzoaog.pdf";
mimeType: application/pdf

DDG downloads provided URL as requested but there is an HTML under this url. Reason why it's impossible to open it as PDF 'cause it's not a PDF. It's also possible to rename downloaded file with *.html suffix and open it as valid web page.

Server responds with PDF to show but android webView doesn't have option to show PDF.

flambers commented 9 months ago

I've experienced dame issue with several pdfs. Then tried to download from another browser and they were noto corrupted. Could you provvide a fix for Android? Thanks

rohit9625 commented 2 months ago

I just tried reproducing this issue on the DDG from the Google Play Store but the PDF was downloaded successfully.

githubyouser commented 1 month ago

I've experienced dame issue with several pdfs. Then tried to download from another browser and they were noto corrupted. Could you provvide a fix for Android? Thanks

I'm experiencing the same issue with PDF files that are generated by mpdf. Other browsers seem to download them fine, but DDG downloads the webpage with a .pdf extension instead of the PDF file.