KMatle Expert Licensed User Longtime User Sep 12, 2019 #1 I show PDF's on my Website via php/html. For security reasons I don't want to publish the filename/-path. So I stream the pdf file Content to the browser which works fine It's similar to this example: Code: Copy $data = file_get_contents("http://bar.com/foo.pdf"); header("Content-type: application/octet-stream"); header("Content-disposition: attachment;filename=YOURFILE.pdf"); echo $data; I want to do the same with B4J. With fx.showexternaldocument you will provide the complete path (which I don't want). Ok, I could copy the pdf to a temp file to show it. So what is the best way to do so? (exactly: How do I "call" the browser with a stream (not file path) or is it better to start f.e. Acrobat Reader directly (as I know it supports streams).
I show PDF's on my Website via php/html. For security reasons I don't want to publish the filename/-path. So I stream the pdf file Content to the browser which works fine It's similar to this example: Code: Copy $data = file_get_contents("http://bar.com/foo.pdf"); header("Content-type: application/octet-stream"); header("Content-disposition: attachment;filename=YOURFILE.pdf"); echo $data; I want to do the same with B4J. With fx.showexternaldocument you will provide the complete path (which I don't want). Ok, I could copy the pdf to a temp file to show it. So what is the best way to do so? (exactly: How do I "call" the browser with a stream (not file path) or is it better to start f.e. Acrobat Reader directly (as I know it supports streams).
Erel B4X founder Staff member Licensed User Longtime User Sep 12, 2019 #2 Using a temporary file for this sounds like a good solution. You can also show it inside your app: https://www.b4x.com/android/forum/t...dule-show-pdf-document-in-b4j.103350/#content Upvote 0
Using a temporary file for this sounds like a good solution. You can also show it inside your app: https://www.b4x.com/android/forum/t...dule-show-pdf-document-in-b4j.103350/#content