I know that similar questions were asked, but none of them answered. As the title implies, the PDF document is successfully extracted to the PC as well as the iPhone from the URL (the URL calls the C # web API controller, and the function returns the PDF file to HttpWebResponse), but as soon as it concerns Android phones, he says “Download Unsuccessful,” unless the link is open in Opera.
The code below shows how a web response from a 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 tried changing the mime type to application / octet-steam, it still does the same thing, and I got stuck in the same problem for 2 business days.
Can anyone help? Or experienced the same disorder?
source share