21
Views
8
Comments
Solved
Storing an image in a Postgres database doesn't show on page. What am I doing wrong?

I am storing an image in my postgres database (as binarydata) but when I go to retrieve the image I am getting a 404 error. I looked at the blob in the database and it seemed wrong but I am not sure how to fix it because the upload widget handles the img data.




BestEverApp.oml
UserImage.jpg
Ben Roth
Solution

After many hours I finally figured out the issue, Apparently the Integration Builder is not as good as Integration Studio. I built my own database extension following this guide and the images now appear as they should.

Edit: Upon further digging I realized that when I switch a primary key to auto generate, images that pull from that table will break. So it may not necessarily be the integration builders fault. 

2023-08-28 07-00-10
Paulo Torres
Champion

Your code seems good, anyway is confused on screen. You don't need a new query to show form, a record on screen it's enough.

About the save is better if you use like that:

If you make a direct query to the database there is no record or you have everything less the binary?

UserImage.jpg
Ben Roth

Everything saves in the database correctly its only the image is causing me problems.

2023-08-28 07-00-10
Paulo Torres
Champion

Also the image is well saved looking for your screenshot.

Try to create a new page only to show One imagem from DB. It corrupt file

UserImage.jpg
Ben Roth

I created a new page with a new aggregator to pull an image from the database and I am still having the same issue with the 404 error. 

2023-08-28 07-00-10
Paulo Torres
Champion
UserImage.jpg
Ben Roth

No I am still unsure how to solve the problem.

UserImage.jpg
Ben Roth
Solution

After many hours I finally figured out the issue, Apparently the Integration Builder is not as good as Integration Studio. I built my own database extension following this guide and the images now appear as they should.

Edit: Upon further digging I realized that when I switch a primary key to auto generate, images that pull from that table will break. So it may not necessarily be the integration builders fault. 

2023-08-28 07-00-10
Paulo Torres
Champion

Good to know this about integration builder.

Thanks to let us know

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.