Saving image from webcam to DB

Saving image from webcam to DB

  

Hello community

I managed to write a HTML5 and JavaScript script that I included in Outsystem's expression  of the web application I am busy with; that allows users to take a picture. 

Now, my only battle is trying to save that image into my OutSystems database - where there is a table to store images. I need help in modifying a code that, when the "Capture" button is clicked, this picture/image is saved into the table. 


Is this possible, as the database is in OutSystems and the code is just included form a separate file? 


Thank you

Mvuyo

Hi Mvuyo,

One approach I already saw is to provide a named input in OutSystems page, usually hidden, that you pass the id to tour JavaScript to store the image there, usually as base64, that is available to be saved when submitting.

I think you can also use an upload widget the same way, and provide the binary through the content.

The idea is to store the information you want to submit in an input that OutSystems knows about it.

If your JavaScript is in a separated file and is loaded in the Head section, you need to set the code to be executed when the DOM is read, in order to it to find the input (through a set of classes), and be able to store there the info.

Cheers

Eduardo Jauch

Thank you Eduardo. 

I also tried some Camera plug that is not working at the moment. SO at the moment I am giving your suggestion a try. 

Hi Mvuyo,

Can you say which plugin you tried that is not working and what is the error?

Cheers,
Eduardo Jauch

Eduardo Jauch wrote:

Hi Mvuyo,

Can you say which plugin you tried that is not working and what is the error?

Cheers,
Eduardo Jauch

Hello Eduardo.


Pardon me, my bad, I had been trying to use a mobile app plug-in instead of one that is suitable for web applications. Sorry about that. I will get back you when I encounter more problems.


Kind Regards


Mvuyo Mdekazi wrote:

Eduardo Jauch wrote:

Hi Mvuyo,

Can you say which plugin you tried that is not working and what is the error?

Cheers,
Eduardo Jauch

Hello Eduardo.


Pardon me, my bad, I had been trying to use a mobile app plug-in instead of one that is suitable for web applications. Sorry about that. I will get back you when I encounter more problems.


Kind Regards


No problems :)

Cheers,
Eduardo Jauch