How do I save a photo from camera to the database.

How do I save a photo from camera to the database.

  
Hi all.


I have a module that access my laptop camera using outsystemnow.  it takes the picture and put it on the form image, but when I try to save, the input field of the photo gives me an error that says "You must enter a text with 50 or fewer characters"  I changed it to Max 5000 but it is still giving me the error.

Can someone help me on how I can go about saving a image from camera to the database
Hi Segonto,

I'm not sure what "input field of the photo" you mean. If you can display the image on the screen, you have the binary data, right? You can save that to the database. An image doesn't live in an input field.

Hi Kilian

Here is the photo.
So what's that input box doing below the photo? Can you share the eSpace (or a simple deravitive that shows the same problem)?
I have followed the instructions I got from outsystemsnow features.  learn how to take pictures with your app.
It does take the picture all I need is how to save it on the database. the logic behind it.
Solution
Thanks for the instructions, that makes things clearer. The instructions are not completely correct: first they mention a variable "PhotoVar" which is bound to the input box, but at the end they mention "PictureVar" for storing it when saving. I assume they mean "PhotoVar" there.

To store this data in the database, you need a table with two attributes: an Id and one of type Binary Data. You assign the PhotoVar to the binary data atrribute, and save it.
Solution
Kilian Hekhuis wrote:
Thanks for the instructions, that makes things clearer. The instructions are not completely correct: first they mention a variable "PhotoVar" which is bound to the input box, but at the end they mention "PictureVar" for storing it when saving. I assume they mean "PhotoVar" there.

To store this data in the database, you need a table with two attributes: an Id and one of type Binary Data. You assign the PhotoVar to the binary data atrribute, and save it.
 
 Don't forget to convert the text to binary before assigning it otherwise you won't be able to proceed 
Killian and John  thank you so much, now it is working .   
Hi Segonto,

That's good to hear!
Nice work!