# Get Path to File

**URL:** <https://forum.inductiveautomation.com/t/get-path-to-file/45504>\
**Category:** Ignition\
**Created:** [April 12, 2021, 6:17pm UTC](https://forum.inductiveautomation.com/t/get-path-to-file/45504 "2021-04-12T18:17:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![kghali](https://avatars.discourse-cdn.com/v4/letter/k/da6949/32.png) [@kghali](https://forum.inductiveautomation.com/u/kghali)\
**Post date:** [April 12, 2021, 6:17pm UTC](https://forum.inductiveautomation.com/t/get-path-to-file/45504/1 "2021-04-12T18:17:39Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 12, 2021, 6:51pm UTC](https://forum.inductiveautomation.com/t/get-path-to-file/45504/2 "2021-04-12T18:51:26Z")

</div>

You can’t. You _must_ use the File Upload component for this purpose; browsers put heavy restrictions on access to uploading files.

---

<div class="post-metadata">

**Author:** ![kghali](https://avatars.discourse-cdn.com/v4/letter/k/da6949/32.png) [@kghali](https://forum.inductiveautomation.com/u/kghali)\
**Post date:** [April 12, 2021, 6:52pm UTC](https://forum.inductiveautomation.com/t/get-path-to-file/45504/3 "2021-04-12T18:52:54Z")

</div>

I will upload the file with the File Uploader to a Mounted Folder and return the name of the file.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [April 12, 2021, 8:52pm UTC](https://forum.inductiveautomation.com/t/get-path-to-file/45504/4 "2021-04-12T20:52:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 12, 2021, 8:55pm UTC](https://forum.inductiveautomation.com/t/get-path-to-file/45504/5 "2021-04-12T20:55:29Z")

</div>

Perspective makes this hard; you can’t easily display a PDF without hosting it somewhere (such as with Webdev).

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [April 12, 2021, 8:57pm UTC](https://forum.inductiveautomation.com/t/get-path-to-file/45504/6 "2021-04-12T20:57:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![kghali](https://avatars.discourse-cdn.com/v4/letter/k/da6949/32.png) [@kghali](https://forum.inductiveautomation.com/u/kghali)\
**Post date:** [April 14, 2021, 11:24am UTC](https://forum.inductiveautomation.com/t/get-path-to-file/45504/7 "2021-04-14T11:24:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [April 14, 2021, 12:50pm UTC](https://forum.inductiveautomation.com/t/get-path-to-file/45504/8 "2021-04-14T12:50:27Z")

</div>

> [@paul-griffith](#):
>
> _ **Browsers** _ ~~Perspective~~ make this hard;

FIFY.

(Browsers do this out of necessity for security, not as a pointed attack on controls engineers.)
