# Upload Text File to View And Download Text File from View

**URL:** <https://forum.inductiveautomation.com/t/upload-text-file-to-view-and-download-text-file-from-view/111332>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [October 9, 2025, 11:29pm UTC](https://forum.inductiveautomation.com/t/upload-text-file-to-view-and-download-text-file-from-view/111332 "2025-10-09T23:29:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [October 9, 2025, 11:29pm UTC](https://forum.inductiveautomation.com/t/upload-text-file-to-view-and-download-text-file-from-view/111332/1 "2025-10-09T23:29:21Z")

</div>

### To Upload to View.

I would:

1. I would write the uploaded byte into tempFilePath:

```python
	#creates a temporary file (with given extension) on host
	tempFilePath = system.file.getTempFile(fileExt)
	#write file byte to temporary file
	system.file.writeFile(tempFilePath, fileByte)

```

1. How do I extract the file bite into json and write to custom property?

### To Download, I would:

1. Convert to bytes and download:

```python
	system.perspective.download(filename, excelBytes)

```

1. How do I convert jsonText to file?

---

<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:** [October 9, 2025, 11:39pm UTC](https://forum.inductiveautomation.com/t/upload-text-file-to-view-and-download-text-file-from-view/111332/2 "2025-10-09T23:39:25Z")

</div>

Upload, assuming you're in the context of the File Upload component (because that's the only way to load a file into Perspective):

> **[Perspective - File Upload Scripting | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.3/appendix/components/perspective-components/perspective-input-palette/perspective-file-upload/perspective-file-upload-scripting)**
>
> This page details the various scripting, component, and extension functions available for Perspective's File Upload component.

```python
jsonString = event.file.getString()
json = system.util.jsonDecode(jsonString)

self.custom.myCustomProperty = json

```

Downloading is the inverse operation:

```python
jsonString = system.util.jsonEncode(self.custom.myCustomProperty)
system.perspective.download(filename, jsonString, contentType="application/json")

```
