31
Views
5
Comments
Image will not display on page
Question
Hello everybody,

I add an image by saving its binary data and filename into a table.  When I query this database table for that image to display on the page, the image will not display.....even when I hard code the table's ID into the query for that record.  I get an "X" where my image should show.  What is the deal?  It is a straight forward query.

On the Image widget, I set the followling attributes:
Image - Blank
Type - Database
Filename - " "
Attribute - SummaryInfo.Images(This is the field where the image is stored.)
Entity Identifier - IntegerToEntityReInteger(11)
2020-03-19 14-14-27
Pedro Gonçalves
Staff
Hi Frank,

Be careful when using hardcodes (your Entity Identifier property value)... are you sure that the entity record id 11 does exist in the database?

Please check the post at https://www.outsystems.com/forums/discussion/7174/image-widget-type-database/ ?
There's a sample .oml there that might be just what you need.

Also, let me suggest Service Studio Online Help on Using Database Images which applies to this situation.

Happy coding!
2022-11-12 11-28-30
Gonçalo Martins
Staff
Hello Frank,

To resume, Keep It Simple..If you need to get an image dinamically from your database, use a query in you preparation to perform it ;)

Kind Regards,
GM
2012-03-16 12-21-09
João Rosado
Staff
Hi Frank,

Think you need to give a filename to your image.
Without that the response mimetype gets a default value and most browsers won't render the image without a mime type matching the image format.

If that doesn't work, are you sure the binary is correct in the database?

Regards,
João Rosado
UserImage.jpg
Frank
Ahhhhhh........here is the issue with image upload that maybe Outsystems should try to address. 

The ImageUpload widget allows you to load any kind of file formats....ie word docs, notepad docs, etc.  Outsystems should limit this ImageUpload widget to upload file formats to .jpg, .png, etc.

The reason is that the Image widget can only display .jpg, .png, etc files and not word docs, notepad docs, etc. files.

I was uploading a screen shot that I took and dumped on a word doc and I was able to upload that doc using the ImageUpload widget, but the Image widget does not display word documents.
UserImage.jpg
Frank
Thanks for your help guys.  Each bit of advice enabled me to investigate the matter further to come up with my conclusions!  I could not have solved this mystery without your suggestions and advice.  You guys are the best!!!

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