I have some pdfs that I want to present on Perspective Module. I created a database to upload the paths to it and I want the pdf viewer to fetch the path of each pdf file from the database and present that file.
The problem is that I don’t know how to get the path of the file to perspective. I want the BROWSE button to open an “Open” Window which we can use to navigate to the pdf file, and when the client presses Open, the path to that file will be uploaded to the database. What functions do I need inside the BROWSE button?
You can’t. You must use the File Upload component for this purpose; browsers put heavy restrictions on access to uploading files.
I will upload the file with the File Uploader to a Mounted Folder and return the name of the file.
Why not just save the PDF into the database as blob data and then pull it from there and show it via the PDF viewer?
Perspective makes this hard; you can’t easily display a PDF without hosting it somewhere (such as with Webdev).
Yeah you aren’t joking. We are doing something similar. One system generates a report that then gets transferred via the gateway network to another system and stored in Base64 in the database in the other system. Then viewed on the central system, and distributed out via REST. The hardest part was getting the base64 encoded pdf to show up in the PDF viewer.
I mounted a folder and had a database with the names of the pdf files. Basically, I change the source of the file (only the name part) by getting the name from the database while keeping all the pdf files in the mounted folder.
(Browsers do this out of necessity for security, not as a pointed attack on controls engineers.)