# Upload Image Button

**URL:** <https://forum.inductiveautomation.com/t/upload-image-button/9716>\
**Category:** General Discussion\
**Created:** [February 17, 2015, 1:20am UTC](https://forum.inductiveautomation.com/t/upload-image-button/9716 "2015-02-17T01:20:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Howell](https://avatars.discourse-cdn.com/v4/letter/h/dfb087/32.png) [@Howell](https://forum.inductiveautomation.com/u/Howell)\
**Post date:** [February 17, 2015, 1:20am UTC](https://forum.inductiveautomation.com/t/upload-image-button/9716/1 "2015-02-17T01:20:55Z")

</div>

Is it possible to have a button that opens a file dialog window where the user could select an image? If that is possible, then is it also possible to save that image to MSSQL? Thanks!

---

<div class="post-metadata">

**Author:** ![nmudge](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nmudge/32/3394_2.png) [@nmudge](https://forum.inductiveautomation.com/u/nmudge)\
**Post date:** [February 17, 2015, 2:11am UTC](https://forum.inductiveautomation.com/t/upload-image-button/9716/2 "2015-02-17T02:11:10Z")

</div>

Yes, sure.

Use the [system.file.openFile](https://support.inductiveautomation.com/usermanuals/ignition/index.html?system_file_readfileasbytes.htm) function in the actionPerformed event handler in the button.

Then use the system.file.readFileAsBytes(filepath) function to read an image file and get the bytes.

Then store the bytes in MSSQL.

Best,
