# How to download a BLOB Data in Ignition

**URL:** <https://forum.inductiveautomation.com/t/how-to-download-a-blob-data-in-ignition/5699>\
**Category:** Ignition\
**Created:** [January 18, 2013, 3:35pm UTC](https://forum.inductiveautomation.com/t/how-to-download-a-blob-data-in-ignition/5699 "2013-01-18T15:35:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![caritoel27](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/caritoel27/32/3430_2.png) [@caritoel27](https://forum.inductiveautomation.com/u/caritoel27)\
**Post date:** [January 18, 2013, 3:35pm UTC](https://forum.inductiveautomation.com/t/how-to-download-a-blob-data-in-ignition/5699/1 "2013-01-18T15:35:28Z")

</div>

Hi I write to you, because a need a guide to know how can I do for downloading a specific file from a BLOB table in MySQL.  
I found how to insert or upload the file with system.db.runPrepUpdate() script but now, I need to downoload the file from the BLOB table.

Can you help me please with this problem? 😒

I will appreciate it a lot

Best Regards

Carito

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [January 18, 2013, 4:38pm UTC](https://forum.inductiveautomation.com/t/how-to-download-a-blob-data-in-ignition/5699/2 "2013-01-18T16:38:34Z")

</div>

You can use the system.db.runPrepQuery function. Here is an example:`result = system.db.runPrepQuery("SELECT Blob FROM Table WHERE ID = ?", [id])
if len(result):
    blob = result[0][0] # You can now use the blob for whatever you want
    system.file.writeFile("C:\\Some\\Path\\to\\File.ext", blob)`

---

<div class="post-metadata">

**Author:** ![caritoel27](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/caritoel27/32/3430_2.png) [@caritoel27](https://forum.inductiveautomation.com/u/caritoel27)\
**Post date:** [January 18, 2013, 6:21pm UTC](https://forum.inductiveautomation.com/t/how-to-download-a-blob-data-in-ignition/5699/3 "2013-01-18T18:21:18Z")

</div>

Thank you very much!!! Travis ![:prayer:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e5a7e3b63facc151ea73e3b45db7bdb3d4bdc316.gif ":prayer:") ![:thumb_left:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e26afb081ddde6df016df6ee49159cf56aaca688.gif ":thumb\_left:") It’s works very well 🙂

Best Regards

Carito
