1476
Views
10
Comments
How to upload an image to the database and show it

Hello guys,


I want to upload an image to the databse. I tried using the upload an image widgets. Somehow it does not upload anything to the database. The documentations are very bluntly, i do not understand it very well. I followed an article on the forum but it is still not working. SO shortly, i want to upload an image specific to an ID and then show the uploaded image on that id only.

Upload.oml
2023-04-07 07-55-02
Krushna Mantri

Hi Samed,

You can save the image in DB with field attribute data type as Binary data, I made changes in your OML file for your reference(Find attachment)

Hope it will help you

Thanks & Regards,

Krushna

Upload.oml
2026-02-26 06-29-24
Rahul
 
MVP

Hi Samed, 

I saw you oml and there is no attribute for store image,

As @Krushana Mantri  said you need to use Binary data type in entity attribute.


Regards

Rahul

Upload.oml
2019-07-05 10-57-41
Nikhil Purohit

Hi Samed,

I went through your OML, please mark the changes I have done.

1. Entity should have Binary Data attribute to save File Content and Text attribute to store Filename.

2. You must pass the data to the server action to store in the entity.


3. As it is Reactive web application, pass the data through client action.



Please check the attached OML now as it is working for uploading now. Also create the parent record i.e. Gegevens in entity and then create GegevenFoto and accordingly pass GegevensId to save the photo.


Hope this helps!


Regards,

Nikhil Purohit

UploadRenewed.oml
UserImage.jpg
Samed Gurses

Hi guys, first of all thank you all for the quick resopnses, but when i download one of your OML and try to publish it, i get the next error: 

2023-04-07 07-55-02
Krushna Mantri

Samed Gurses wrote:

Hi guys, first of all thank you all for the quick resopnses, but when i download one of your OML and try to publish it, i get the next error: 

 HI,

Please find attached OML with a new attribute in the entity with data type as binary

 

Upload.oml
UserImage.jpg
Samed Gurses

Krushana Mantri wrote:

Samed Gurses wrote:

Hi guys, first of all thank you all for the quick resopnses, but when i download one of your OML and try to publish it, i get the next error: 

 HI,

Please find attached OML with a new attribute in the entity with data type as binary

 

 Hi,


I tried your OML, it works, but now i have other problems. Offcourse the delete function "Verwijder" on the detail page does not work anymore. And the search bar does also no work. Do you know what i need to implement to let the delete and search buttons work again?


Cheers

 

2019-07-05 10-57-41
Nikhil Purohit

Hi Samed,

Please check the error log properly, you will need to create a new attribute to save Binary Data in GegevenFoto and map that field with your logic.

Regards,

Nikhil

UserImage.jpg
Samed Gurses

Nikhil Purohit wrote:

Hi Samed,

Please check the error log properly, you will need to create a new attribute to save Binary Data in GegevenFoto and map that field with your logic.

Regards,

Nikhil

 

 Hi Nikhil,


As i am new to Outsystems, i do not know how to do it. I created a new entity attribute, but beyond that i dont know it. How can i map that field with logic? Can you please explain it step by step?


Regards,


Samed

2026-02-26 06-29-24
Rahul
 
MVP

Samed Gurses wrote:

Nikhil Purohit wrote:

Hi Samed,

Please check the error log properly, you will need to create a new attribute to save Binary Data in GegevenFoto and map that field with your logic.

Regards,

Nikhil

 

 Hi Nikhil,


As i am new to Outsystems, i do not know how to do it. I created a new entity attribute, but beyond that i dont know it. How can i map that field with logic? Can you please explain it step by step?


Regards,


Samed

 

 Hi Samed,

you are getting error because in your entity have attribute text type and it convert in binary.

and you entity have already text data in this column and can not convert in binary data type .

so you need to add new column for save image binary data type or delete all for this entity and after that change datatype.


Regards

Rahul

2023-04-07 07-55-02
Krushna Mantri

Hi Samed,

On the search button just refresh your aggregate(which is bonded with your Table) and keep a filter like below in aggregate (in below example added filter for searching movies by Title)

before deleting the entity record please read the Outsystems delete a rule, you can refer below link for the same:

https://success.outsystems.com/Documentation/11/Developing_an_Application/Use_Data/Data_Modeling/Entity_Relationships/Delete_Rules

to delete you can use the Delete action of the entity


hope it will help you

Thanks & Regards,

Krushna

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