# Need help with PostgreSQL bytea type

**URL:** <https://discourse.cakephp.org/t/need-help-with-postgresql-bytea-type/4029>\
**Category:** Need Help\
**Created:** [March 9, 2018, 5:14am UTC](https://discourse.cakephp.org/t/need-help-with-postgresql-bytea-type/4029 "2018-03-09T05:14:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hectorviov](https://avatars.discourse-cdn.com/v4/letter/h/6bbea6/32.png) [@hectorviov](https://discourse.cakephp.org/u/hectorviov)\
**Post date:** [March 9, 2018, 5:14am UTC](https://discourse.cakephp.org/t/need-help-with-postgresql-bytea-type/4029/1 "2018-03-09T05:14:27Z")

</div>

Hello, this is my first time in here, so if I need to show you something like code or examples please let me know.

So I’m working with a company which uses PostgreSQL database and has some jpeg files saved to a table in the database with type bytea. After reading the documentation I get that in Cakephp it is treated as binary data. The first problem I have is that when I do a find(‘all’) to the table in where the pictures are, I get the text and numbers data correctly, but the bytea data is retrieved as ‘null’. How can I get the data of the picture and return it as an image to the user? I couldn’t find an example anywhere. Please help!
