I know similar questions have been asked, but none of them were answered. As the heading suggests, a PDF document is successfully retrieved on PC as well as iPhones from the URL (URL calls the controller of a C# Web API and the function returns a PDF in HttpWebResponse), but as soon as it comes to Android phones, it says "Download Unsuccessful", unless the link is opened in Opera.
The code below shows how the web response from the third party web service is converted to pdf and displayed:
bytes = Convert.FromBase64String(node.Value);
res.Content = new ByteArrayContent(bytes);
res.Content.Headers.ContentType = new MediaTypeHeaderValue("application/pdf");
res.Content.Headers.Add("Content-Disposition", "inline; filename=NatisDocument.PDF");
I have tried changing the mime type to application/octet-steam, it still does the same thing, and I have been stuck on the same issue for 2 working days.
Can anyone help? Or has experienced the same frustration?
It may just be an server error just try again or try a different source, if the error still reoccurs then just try a different browser such UC & Opera, i havn't seen a download fail in these two unless it is from a really bad source. What is the download mode on Android? Some apps suddenly quit when opening in Android.
Go to Settings>Apps, tap Menu>Show System, select Download Manager, then Storage, then Clear Cache/Clear Data.
On an Android 4.4.2 device I have no problem with 'online' opening of PDF in Mozilla Firefox. However, the "Download Unsuccessful" error occurs in Google Chrome and the native Android browser only when retrieving PDF from secure URL (https://...). In such a case, do not tap on link, but press on link and choose 'Save link' in the context menu; then press 'Open'. See also https://android.stackexchange.com/questions/62894/android-download-pdf-giving-download-unsuccessful
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With