# System.perspective.download() in an Android Tablet

**URL:** <https://forum.inductiveautomation.com/t/system-perspective-download-in-an-android-tablet/96081>\
**Category:** Ignition\
**Tags:** ignition81, scripting, perspective\
**Created:** [September 17, 2024, 5:41pm UTC](https://forum.inductiveautomation.com/t/system-perspective-download-in-an-android-tablet/96081 "2024-09-17T17:41:07Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samuel\_Sinohui](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@Samuel\_Sinohui](https://forum.inductiveautomation.com/u/Samuel_Sinohui)\
**Post date:** [September 17, 2024, 5:41pm UTC](https://forum.inductiveautomation.com/t/system-perspective-download-in-an-android-tablet/96081/1 "2024-09-17T17:41:07Z")

</div>

When I use the command: system.perspective.download() in the Ignition Designer, the save prompt appears with no issues (I have it linked to a button).

But when I try this on the Ignition Perspective App in my Samsung Tablet, it does nothing.  
I checked if maybe it went to My Files app, but nothing was there either.

I couldn't find more information regarding this online, so I'm a bit confused on how to make the command work on the mobile app.

---

<div class="post-metadata">

**Author:** ![Ken\_Pace](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ken_pace/32/36092_2.png) [@Ken\_Pace](https://forum.inductiveautomation.com/u/Ken_Pace)\
**Post date:** [September 17, 2024, 6:48pm UTC](https://forum.inductiveautomation.com/t/system-perspective-download-in-an-android-tablet/96081/2 "2024-09-17T18:48:10Z")

</div>

Hopefully this will help: [[PM-162] IOS and system.perspective.download - #3 by Ken\_Pace](https://forum.inductiveautomation.com/t/pm-162-ios-and-system-perspective-download/73671/3)

---

<div class="post-metadata">

**Author:** ![Samuel\_Sinohui](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@Samuel\_Sinohui](https://forum.inductiveautomation.com/u/Samuel_Sinohui)\
**Post date:** [September 17, 2024, 8:21pm UTC](https://forum.inductiveautomation.com/t/system-perspective-download-in-an-android-tablet/96081/3 "2024-09-17T20:21:44Z")

</div>

Since in my case I want to download is an Excel file, i would think that the solution doesn't apply,  
I used the:  
`contentType = MimeTypeUtils.determineMimeType(exportName)`  
line of code,  
and included it to my download:

`system.perspective.download(filename = exportName, data = excel, contentType = contentType)`

but the results are the same unfortunately.

---

<div class="post-metadata">

**Author:** ![Ken\_Pace](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ken_pace/32/36092_2.png) [@Ken\_Pace](https://forum.inductiveautomation.com/u/Ken_Pace)\
**Post date:** [September 17, 2024, 9:04pm UTC](https://forum.inductiveautomation.com/t/system-perspective-download-in-an-android-tablet/96081/5 "2024-09-17T21:04:19Z")

</div>

Can you elaborate on what results you're seeing? Anything in the UI? Also, is this with v1.0.8 of the Ignition Perspective app? For what it's worth, the code in that linked message works for me on a Pixel 5 running Android 14.

---

<div class="post-metadata">

**Author:** ![Samuel\_Sinohui](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@Samuel\_Sinohui](https://forum.inductiveautomation.com/u/Samuel_Sinohui)\
**Post date:** [September 18, 2024, 2:40pm UTC](https://forum.inductiveautomation.com/t/system-perspective-download-in-an-android-tablet/96081/6 "2024-09-18T14:40:22Z")

</div>

I do have v1.08 of Ignition Perspective app.

My approach is most likely wrong, but here is what I tested:

```python
excel = system.dataset.toExcel(True, sheets, nullsEmpty=True, sheetNames=sheetNames)
fileName = excel
target = File(fileName)

data = system.file.readFileAsBytes(fileName)
fileName = target.getName()
contentType = MimeTypeUtils.determineMimeType(fileName)
system.perspective.download(filename = fileName, data = data, contentType = contentType)

```

In this case, `excel` is my data that I want to download.

It returns this in Ignition Perspective:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/2/1239bfa769813aba32c5b05cd78ac2fd622475e4.png)

It should be returning a save prompt, it did before using the designer, but my problem is that since I want to download an .xlsx file, I may need something else to do this.

---

<div class="post-metadata">

**Author:** ![Ken\_Pace](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ken_pace/32/36092_2.png) [@Ken\_Pace](https://forum.inductiveautomation.com/u/Ken_Pace)\
**Post date:** [September 18, 2024, 9:33pm UTC](https://forum.inductiveautomation.com/t/system-perspective-download-in-an-android-tablet/96081/7 "2024-09-18T21:33:23Z")

</div>

Take a look again at the example I posted and see if you can use that as a starting point. The excel-file part shouldn't matter, nor should being on mobile as I modified that example and it was able to download an xlsx file just fine. Also, `system.dataset.toExcel` returns a byte array, and the `TypeError` exception is telling you which line it doesn't like.
