# Saving component to mounted folder

**URL:** <https://forum.inductiveautomation.com/t/saving-component-to-mounted-folder/69170>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 30, 2023, 7:06pm UTC](https://forum.inductiveautomation.com/t/saving-component-to-mounted-folder/69170 "2023-01-30T19:06:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mjoseph](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@mjoseph](https://forum.inductiveautomation.com/u/mjoseph)\
**Post date:** [January 30, 2023, 7:06pm UTC](https://forum.inductiveautomation.com/t/saving-component-to-mounted-folder/69170/1 "2023-01-30T19:06:24Z")

</div>

My program has the user enter in text which generates a barcode with the Barcode component. It's then supposed to print the barcode to a label printer on a button press but as far as I know, it's not possible to print a Perspective component view to a printer. As an alternative, I was wondering if I could save the barcode to a mounted folder instead, but I'm not sure if it's possible and/or how to do it. Any help would be appreciated! 🙂

---

<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:** [January 30, 2023, 7:20pm UTC](https://forum.inductiveautomation.com/t/saving-component-to-mounted-folder/69170/2 "2023-01-30T19:20:11Z")

</div>

If you've got the reporting module, you could generate a basic report on-demand that contains just a generated barcode with the data you pass in.

Note that "printing" from Perspective _scripting_ is always going to take place from the gateway. We don't currently have a way to initiate a user-interactive printing flow _on the user agent_ (browser, mobile device, etc).

---

<div class="post-metadata">

**Author:** ![mjoseph](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@mjoseph](https://forum.inductiveautomation.com/u/mjoseph)\
**Post date:** [January 30, 2023, 7:28pm UTC](https://forum.inductiveautomation.com/t/saving-component-to-mounted-folder/69170/3 "2023-01-30T19:28:01Z")

</div>

Generating a report works for me. If I wanted to save a backup of the barcode to a mounted folder, how would I write to the folder (if it's possible)? I've had cases where I needed to read from a folder and encountered no issues, but I haven't tried to write to one yet and I'm unsure how I would go about doing that.

---

<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:** [January 30, 2023, 10:20pm UTC](https://forum.inductiveautomation.com/t/saving-component-to-mounted-folder/69170/4 "2023-01-30T22:20:40Z")

</div>

In theory, if the gateway service has access, you could write to the file either through `system.report.executeAndDistribute`, or retrieve the bytes with `system.report.executeReport` and then `system.file.writeFile`.
