# Another system.perspective.download question

**URL:** <https://forum.inductiveautomation.com/t/another-system-perspective-download-question/92559>\
**Category:** Ignition\
**Tags:** vision, perspective\
**Created:** [June 29, 2024, 2:22am UTC](https://forum.inductiveautomation.com/t/another-system-perspective-download-question/92559 "2024-06-29T02:22:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [June 29, 2024, 2:22am UTC](https://forum.inductiveautomation.com/t/another-system-perspective-download-question/92559/1 "2024-06-29T02:22:34Z")

</div>

I'm guessing from reading the forum, there is no way to create a file and save it to the client's pc using system.perspective.download.

I have a page that allows the user to set a bunch of settings and I was hoping the user could click an export button to save a json file locally. Is the only way to do this to use vision?

I was thinking I could maybe open a browser and dump the json into that so they could copy/paste the text but that's a bit wonky.

Anyone have any tips or suggestions? Thanks

---

<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:** [June 29, 2024, 4:13am UTC](https://forum.inductiveautomation.com/t/another-system-perspective-download-question/92559/2 "2024-06-29T04:13:51Z")

</div>

`system.perspective.download()` causes the browser to open a save file dialog if the user has configured their browser to always ask for where to save.

Teach you users to set their browsers that way. Or use Vision.

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [June 29, 2024, 12:08pm UTC](https://forum.inductiveautomation.com/t/another-system-perspective-download-question/92559/3 "2024-06-29T12:08:24Z")

</div>

Thanks, I have my browser (firefox) to ask where to save the file. I get prompted but when I select a folder nothing gets downloaded. I tried chrome and edge and got the same thing.

I don't see any errors or warnings from the browser. im just putting my json variable into the function, do I need to convert he json to bytes or anything?

Thanks!

---

<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:** [June 29, 2024, 12:40pm UTC](https://forum.inductiveautomation.com/t/another-system-perspective-download-question/92559/4 "2024-06-29T12:40:10Z")

</div>

We will need to see your script to help you out...

---

<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:** [June 29, 2024, 12:55pm UTC](https://forum.inductiveautomation.com/t/another-system-perspective-download-question/92559/5 "2024-06-29T12:55:19Z")

</div>

> [@drewdin](#):
>
> do I need to convert he json to bytes or anything?

JSON isn't one of the supported types for the `data` argument, so yes:

[system.perspective.download()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-perspective/system-perspective-download)

You probably want to run your json dictionary through [system.util.jsonEncode()](https://www.docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-util/system-util-jsonEncode)

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [June 29, 2024, 4:50pm UTC](https://forum.inductiveautomation.com/t/another-system-perspective-download-question/92559/6 "2024-06-29T16:50:02Z")

</div>

Its a simple script, thanks!

```python
data = {'name':{1:1,2:1,etc...}}
system.perspective.download('download_me.json', data)

```

---

<div class="post-metadata">

**Author:** ![drewdin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/drewdin/32/3363_2.png) [@drewdin](https://forum.inductiveautomation.com/u/drewdin)\
**Post date:** [June 29, 2024, 4:52pm UTC](https://forum.inductiveautomation.com/t/another-system-perspective-download-question/92559/7 "2024-06-29T16:52:03Z")

</div>

Awesome, thank you! I didn't know there were unsupported types, I was assuming it would come across as a string but I didn't print the type to find out.

It worked, thank you!
