# Saving Image not writing to file

**URL:** <https://forum.inductiveautomation.com/t/saving-image-not-writing-to-file/44258>\
**Category:** Ignition\
**Created:** [March 9, 2021, 1:12pm UTC](https://forum.inductiveautomation.com/t/saving-image-not-writing-to-file/44258 "2021-03-09T13:12:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anastasia.blinova](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@anastasia.blinova](https://forum.inductiveautomation.com/u/anastasia.blinova)\
**Post date:** [March 9, 2021, 1:12pm UTC](https://forum.inductiveautomation.com/t/saving-image-not-writing-to-file/44258/1 "2021-03-09T13:12:50Z")

</div>

I have a base64 string that I turn into a BufferedImage using ImageIO

Before manipulating it, I want to save to a local drive.

```auto
from javax.imageio import ImageIO
from java.io import File

file_name = "E:\\" + name + "_image.jpeg"
outputFile = File(filename)
ImageIO.write(image, "jpeg", outputFile)

```

When I run it via the script console on Ignition, it writes to the drive with no errors. However when I have it on a script and run it, the image does not write. The rest of the program runs and does not stop at this step.

Does anyone know why it would work in script console but not as ignition script?

---

<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 9, 2021, 2:09pm UTC](https://forum.inductiveautomation.com/t/saving-image-not-writing-to-file/44258/2 "2021-03-09T14:09:27Z")

</div>

Where is the script running? As a tag change event or other tag event, the script will run in the gateway and attempt to write there.

---

<div class="post-metadata">

**Author:** ![anastasia.blinova](https://avatars.discourse-cdn.com/v4/letter/a/a698b9/32.png) [@anastasia.blinova](https://forum.inductiveautomation.com/u/anastasia.blinova)\
**Post date:** [March 9, 2021, 2:24pm UTC](https://forum.inductiveautomation.com/t/saving-image-not-writing-to-file/44258/3 "2021-03-09T14:24:24Z")

</div>

It runs as a Tag Change.

---

<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 9, 2021, 3:18pm UTC](https://forum.inductiveautomation.com/t/saving-image-not-writing-to-file/44258/4 "2021-03-09T15:18:26Z")

</div>

Does the gateway have a physical E: drive, or a mapping in ignition.conf for an E: drive? If so, look for your file there.
