# Need download option in Ignition Perspective

**URL:** <https://forum.inductiveautomation.com/t/need-download-option-in-ignition-perspective/78387>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 25, 2023, 12:04pm UTC](https://forum.inductiveautomation.com/t/need-download-option-in-ignition-perspective/78387 "2023-08-25T12:04:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruchika](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@Ruchika](https://forum.inductiveautomation.com/u/Ruchika)\
**Post date:** [August 25, 2023, 12:04pm UTC](https://forum.inductiveautomation.com/t/need-download-option-in-ignition-perspective/78387/1 "2023-08-25T12:04:54Z")

</div>

I have uploaded my folder of image files into ignition using web dev module. And now I want a option in my view to download a particular image. I added download icon and trying to use onClick- system.perspective.download function but it is downloading a text file on passing the complete image path which is something like- [http://localhost:8088/client/Testing/imagefolder/image1.jpg](http://localhost:8088/client/Testing/imagefolder/image1.jpg)  
So, I need help to achieve this functionality of downloading image on icon click.

---

<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:** [August 25, 2023, 12:59pm UTC](https://forum.inductiveautomation.com/t/need-download-option-in-ignition-perspective/78387/3 "2023-08-25T12:59:12Z")

</div>

You don't need system.perspective.download at all. Just use a link or navigation action or whatever to point the user's browser to the path to the WebDev file.

---

<div class="post-metadata">

**Author:** ![Ruchika](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@Ruchika](https://forum.inductiveautomation.com/u/Ruchika)\
**Post date:** [August 25, 2023, 1:01pm UTC](https://forum.inductiveautomation.com/t/need-download-option-in-ignition-perspective/78387/4 "2023-08-25T13:01:00Z")

</div>

But I want to download the image. How can I do that ?

---

<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:** [August 25, 2023, 1:21pm UTC](https://forum.inductiveautomation.com/t/need-download-option-in-ignition-perspective/78387/5 "2023-08-25T13:21:38Z")

</div>

You can have a click action call `system.perspective.download()` with the binary image data and suggested download information, but the browser decides on its own whether to actually do that--it might just display the image anyways.

(If you do use `system.perspective.download()`, you **don't** use the WebDev URL, you just perform the same operations as the WebDev script to obtain the image bytes. That part should be in a project library script.)

---

<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:** [August 25, 2023, 1:49pm UTC](https://forum.inductiveautomation.com/t/need-download-option-in-ignition-perspective/78387/6 "2023-08-25T13:49:11Z")

</div>

He's using a mounted folder (I'm pretty sure), which makes this difficult.  
You _can_ emulate the mounted folder option in a Python endpoint, but you have to be aware of file traversal risks.

The basic thing is that you need a content-disposition header added to the response, which is what tells the user agent (web browser) to download the file instead of displaying it. Currently webdev doesn't let you do this for mounted files or folders, so you have to work around that somehow. The easiest, least scripting involved option might be to change from an image folder to a table in your DB so you can easily and safely retrieve images.

---

<div class="post-metadata">

**Author:** ![Ruchika](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@Ruchika](https://forum.inductiveautomation.com/u/Ruchika)\
**Post date:** [September 1, 2023, 7:51am UTC](https://forum.inductiveautomation.com/t/need-download-option-in-ignition-perspective/78387/7 "2023-09-01T07:51:42Z")

</div>

Can you please share more details on how it could be done ? How can we get image byte ?

---

<div class="post-metadata">

**Author:** ![Adarsh\_K](https://avatars.discourse-cdn.com/v4/letter/a/ee7513/32.png) [@Adarsh\_K](https://forum.inductiveautomation.com/u/Adarsh_K)\
**Post date:** [February 2, 2024, 5:33am UTC](https://forum.inductiveautomation.com/t/need-download-option-in-ignition-perspective/78387/8 "2024-02-02T05:33:39Z")

</div>

event.file.getBytes()  
This should be working to get bytes
