1404
Views
5
Comments
Solved
Storing image in entity or structure
Question

I want to store a image for a person detail . and further I need access the image . where I can store the image . it is possible to store image in a entity or structure.

with regards 

Sanjay S


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Sanjay,

Like Pramod says, you use the Binary data type to do so. What I'd like to add, is that in case you want to store them in the database, it is good practice to have a seperate Entity that contains just an Id and the Binary data (and optionally the file name or the like). The reason for this is that databases store binary content in a specific way, which may interfere (as in "slow down") with normal database stuff like searching and indexing.

So say you want to store the image of a person, and you already have a Person Entity, create a seperate PersonImage entity that stores the image, and uses a "Person Id" as its identifier (so you have a 1:1 relationship).

2025-08-22 10-19-44
Pramod Jain
 
MVP

Hi Sanjay,

Yes you can store the image in binary form in the entity.


Regards

-pj-

UserImage.jpg
Sanjay S

Pramod Jain wrote:

Hi Sanjay,

Yes you can store the image in binary form in the entity.


Regards

thanks for all yourdetail explanation .Its really usefull.


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP
Solution

Hi Sanjay,

Like Pramod says, you use the Binary data type to do so. What I'd like to add, is that in case you want to store them in the database, it is good practice to have a seperate Entity that contains just an Id and the Binary data (and optionally the file name or the like). The reason for this is that databases store binary content in a specific way, which may interfere (as in "slow down") with normal database stuff like searching and indexing.

So say you want to store the image of a person, and you already have a Person Entity, create a seperate PersonImage entity that stores the image, and uses a "Person Id" as its identifier (so you have a 1:1 relationship).

2025-08-22 10-19-44
Pramod Jain
 
MVP

Hi Kilian, Thanks for the explanation , i wanted to right the same but was in middel of doing something urgent and thus replied in one liner.

Sanjay you should have your answer now or you want any example


Regards

-PJ-

2021-05-05 07-35-47
Vera Tiago
Staff

Hi Sanjay,

You can store your binary file in an entity. You just need to add an Entity Attribute (Data Type: Binary).

As for the process to upload your image, you need to use the Upload widget. Check this article:

https://success.outsystems.com/Documentation/10/Developing_an_Application/Design_UI/Inputs/Upload_Files

To access the image afterward - I mean, show it on the screen - you just need to drag an drop the image widget into your screen, and under the tab properties select Type: Database, and then select the source for File Name and Binary File.



Vera

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