Image in Entity Atribute

Image in Entity Atribute

I want to associate a atrribute in a Entity with an Image, like a photo of a user for exemple.
How can i do this?

Thank you
Hi Ricardo,

Here's what you can do. You should separate binary data elements from the entity. Let's say you have an entity contact to which you want to add an image. First create an entity ContactImage with an Id an a Content attributes, being the last one of type BinaryData. Now add the corresponding foreign key to your Contact entity.

You now have to code a webscreen to upload the image. Then you can use the image widget to present that image back in a webscreen. Search the help to see how to use the image widget.

Hope this helps you.


It worked!:) thank you

I'm having a little bit of trouble with the same situation.

I've followed this sample (which works):

The only main difference I see between the two is that I use a .xif extension to access database tables in SQL Server 2005 and I'm not creating the entities directly in outsystems. (but I think I've tryed creating the entity to hold the pictures in outsystems and still it didn't work)

I have a contact's entity (several columns and a FK to the picture's entity), and a picture's entity (Id, Content, Filename).

I have a page to upload the pictures and I can use the download action to download the image to disk.

I can not, however, display the picture in the web screen I don't know why.

I've compared everything I could remember between eSpaces, Standard Mode vs Quirks, cookies, cache...

Can I be missing something really stupid? =S