# Image not stored in database

**URL:** <https://forum.servoy.com/t/image-not-stored-in-database/16483>\
**Category:** Classic Servoy\
**Created:** [September 17, 2012, 9:04am UTC](https://forum.servoy.com/t/image-not-stored-in-database/16483 "2012-09-17T09:04:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![omar](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@omar](https://forum.servoy.com/u/omar)\
**Post date:** [September 17, 2012, 9:04am UTC](https://forum.servoy.com/t/image-not-stored-in-database/16483/1 "2012-09-17T09:04:29Z")

</div>

Hi Guys,

When I try to create a new record containing a media field (bytea field in the PostgreSQL database) and I load an image into it using the SmartClient, the record is not saved. This applies to new tables I create, but also to the example\_data.employee table which contains a photo field. Any suggestions? Thx.

---

<div class="post-metadata">

**Author:** ![AlanBourke](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@AlanBourke](https://forum.servoy.com/u/AlanBourke)\
**Post date:** [September 17, 2012, 9:22am UTC](https://forum.servoy.com/t/image-not-stored-in-database/16483/2 "2012-09-17T09:22:35Z")

</div>

My suggestion would be don’t store binary media in database fields, just store a link to a disk file, but I suspect you don’t want to do that ![:D]( "Very Happy")

---

<div class="post-metadata">

**Author:** ![omar](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@omar](https://forum.servoy.com/u/omar)\
**Post date:** [September 17, 2012, 10:34am UTC](https://forum.servoy.com/t/image-not-stored-in-database/16483/3 "2012-09-17T10:34:57Z")

</div>

Hi Alan,

That’s right, thanks anyway. I’ve seen it work before so I am not sure what the problem could be. Bug?

---

<div class="post-metadata">

**Author:** ![Joas](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/joas/32/5095_2.png) [@Joas](https://forum.servoy.com/u/Joas)\
**Post date:** [September 17, 2012, 11:17am UTC](https://forum.servoy.com/t/image-not-stored-in-database/16483/4 "2012-09-17T11:17:45Z")

</div>

It works for me in 6.1.2 with postgres. Have you checked the logs?

---

<div class="post-metadata">

**Author:** ![omar](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@omar](https://forum.servoy.com/u/omar)\
**Post date:** [September 17, 2012, 12:58pm UTC](https://forum.servoy.com/t/image-not-stored-in-database/16483/5 "2012-09-17T12:58:34Z")

</div>

Hi Joas,

Nothing in the log… Something is wrong however because I cannot save changes at all anymore, even without a media field.

---

<div class="post-metadata">

**Author:** ![RonG](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@RonG](https://forum.servoy.com/u/RonG)\
**Post date:** [September 17, 2012, 2:54pm UTC](https://forum.servoy.com/t/image-not-stored-in-database/16483/6 "2012-09-17T14:54:18Z")

</div>

Hi Joas,

I’m storing my images as bytea, which comes across in Servoy as “media”, and I’m able to save them in the database.

Oh, I just see that your latest note says that you’re having trouble saving records at all, not just image-related.

Is it just saving to the table with the images that’s giving you a problem? Or doing saves anywhere? Isolating that might help you a bit (but you probably already know that ![:)]( "Smile") )

Ron
