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.
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
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
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
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:
Samed Gurses wrote:
HI,
Please find attached OML with a new attribute in the entity with data type as binary
Krushana Mantri wrote:
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
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.
Nikhil
Nikhil Purohit wrote:
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?
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.
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