# \[PM-162\] IOS and system.perspective.download

**URL:** <https://forum.inductiveautomation.com/t/pm-162-ios-and-system-perspective-download/73671>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [May 12, 2023, 9:20pm UTC](https://forum.inductiveautomation.com/t/pm-162-ios-and-system-perspective-download/73671 "2023-05-12T21:20:15Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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:** [May 15, 2023, 7:42pm UTC](https://forum.inductiveautomation.com/t/pm-162-ios-and-system-perspective-download/73671/3 "2023-05-15T19:42:42Z")

</div>

Try specifying a Mime type. Here's an example of an onClick action where an image file is in the gateway's data folder.

Edit: I've also filed a ticket to look into making this a bit better.

````auto
	from java.io import File
	from com.inductiveautomation.ignition.gateway.util import MimeTypeUtils
	
	fileName = 'data/image.png'
	
	target = File(fileName)
	
	if (target.exists()):
		data = system.file.readFileAsBytes(fileName)
		fileName = target.getName()
		contentType = MimeTypeUtils.determineMimeType(fileName)
		system.perspective.download(filename = fileName, data = data, contentType = contentType)```
````

---

_[View the full topic](https://forum.inductiveautomation.com/t/pm-162-ios-and-system-perspective-download/73671)._
