# System.perspective.download wrong encoding

**URL:** <https://forum.inductiveautomation.com/t/system-perspective-download-wrong-encoding/57049>\
**Category:** Ignition\
**Tags:** ignition80, perspective, scripting\
**Created:** [March 10, 2022, 4:54am UTC](https://forum.inductiveautomation.com/t/system-perspective-download-wrong-encoding/57049 "2022-03-10T04:54:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tc.wang](https://avatars.discourse-cdn.com/v4/letter/t/45deac/32.png) [@tc.wang](https://forum.inductiveautomation.com/u/tc.wang)\
**Post date:** [March 10, 2022, 4:54am UTC](https://forum.inductiveautomation.com/t/system-perspective-download-wrong-encoding/57049/1 "2022-03-10T04:54:10Z")

</div>

the file i downloaded from gateway server to my PC by the script system.perspective.download

i can not open the file in my PC  
but i can open the file in gateway server PC  
filetype is image

```auto
	from wellrain_lib import messageBox
	try:
		# 打开指定路径的文件
		path = self.getSibling("Table").custom.sel_row.path
		name = self.getSibling("Table").custom.sel_row.filename
		f = open(path, mode = "rb")
		file_data = f.read()
		# 执行下载操作
		system.perspective.download(name,file_data,contentType = "multipart/form-data")
		
	except:
		messageBox.errorBox()

```

the image i downloaded to my PC open like this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/9/2/922fe2b5e52cbfcc6a2a4f659d8a462e6ca15f3f.png)  
the PDF file i downloaded  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/7/6/760850d418143f35d0e1d2fcb04c1ef78889c2ae.png)

---

<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:** [March 10, 2022, 12:51pm UTC](https://forum.inductiveautomation.com/t/system-perspective-download-wrong-encoding/57049/2 "2022-03-10T12:51:49Z")

</div>

Use the proper contentType for your image. `multipart/form-data` is for posting a form _ **TO** _ a server, not downloading _ **FROM** _ a server.
