NetTalk Central

NetTalk Web Server => Web Server - Ask For Help => Topic started by: Stu on November 20, 2013, 03:16:08 PM

Title: Downloading PDF from nt webserver on Android - Adobe Issue
Post by: Stu on November 20, 2013, 03:16:08 PM
Hi Folks,

Nettalk 7.28
Clarion 8 (last)

This functionality works great on the desktop, and possibly other devices. I've discovered a problem with Android phones and the android adobe reader.

1. Have a nettalk webserver (non ssl).

2. Have a button on a form which, depending on a number of things, when clicked will "download" a pdf.

3. This code lives in the _SendFile embed of the WebHandler:

Code: [Select]
self.ForceNoCache = 1
self.ReplyContentType = 'application/pdf'
p_Header = NET:SendHeader+net:DontCache

4. Am running chrome browser on android, go to the page, click the button.

5. Comes up with "Complete action using" dialogue .. I choose Adobe Reader.

6. Error message appears:

Code: [Select]
Error opening document. Please try again later.
--

So I a-looking, and discover this: http://stackoverflow.com/questions/12178071/open-a-pdf-document-in-adobe-reader-from-app, which talks about changing Uri.parse(path) to Uri.fromFile(new File(path)) - it also has a link to a java question which apparently answers the issue.

Anyone able to help me work out:

1) If this is the answer, and
2) How to set nettalk to do whatever it is that is being done in that code.

** If you choose "Chrome" to open the pdf on android, it works fine. Opens in Adobe, just a different way I'm guessing. Chrome possibly does the downloading?
Title: Re: Downloading PDF from nt webserver on Android - Adobe Issue
Post by: Stu on December 01, 2013, 07:28:15 PM
Bumpity bump.

Anyone got a thought or two on this? Maybe a direction I could head in .. A magic wand to wave?