Saving files in ignition

can help #system.file.saveFile("jmutuc", ".txt", "try testing")
image
then clicking save
it output
image

but the file does not exist? what can i do for that?

system.file.saveFile returns a file path if the user clicks save. It doesn't actually save a file. You'll need to call another function for that. Have a look at the code examples in the user manual.

1 Like

okay i will try

thankyou dear. it works

You tagged this as Perspective. If you're testing in the script console and expecting this to work in Perspective, you'll be disappointed.

You cannot, full stop, force the user agent (web browser, mobile device, etc) to give you a file picker, get a filename, and write data to an arbitrary file on the web. The system.file function you are using will only work in the Designer (while the Vision module is installed) and in a Vision client.

yes im testing only in script console.. it works . but what can i do in perspective view/ web

system.perspective.download.

You can suggest a filename and provide a content type to the user agent. Everything else is out of your control.

thankyou for the information