Storing image in entity or structure

Storing image in entity or structure

  

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


Hi Sanjay,

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


Regards

-pj-

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).

Solution

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-

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

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.