Page 1 of 1

How to save a photo to server which is newly taken on client

Posted: Fri Jun 03, 2016 5:58 pm
by MegumiSawada
Hi,

The customer is using LANSA Mobile.
They would like to take a photo, show it on image control on Web page,and save it to the sever.

I have succeeded in take a photo and show it on image control on the web page (Base 64 encoded).
#Image1.FileName := "data:image/png;base64," + #CameraUse.ImageAsBase64Data
However, I don't know how to save it to the server.
Is it possible to save it (BASE64 encoded = String type) to BLOB field on a file in the server?
If yes, could you please let me know how to?

Sorry for the basic question.
Thanks in advance.

Best Regards,
Megumi Sawada

Re: How to save a photo to server which is newly taken on client

Posted: Fri Jun 03, 2016 6:08 pm
by Stewart Marshall
Hi Meg

As shown in xDemoWebImageCapture, the selected file needs to be stored in a blob field

Code: Select all

Evtroutine Handling(#FilePicker.FileSelected) File(#File)

#Image.FileName #xDemoblob := #File.Blob

Endroutine
The blob can then be sent to the server the same as any LANSA field. Once there, OV_FILE_SERVICE can be used to manipulate the location of the physical object. This thread provides a little more detail.

http://vlforum.lansa.com.au/viewtopic.p ... RVICE#p176

Regards

Re: How to save a photo to server which is newly taken on client

Posted: Tue Jun 07, 2016 2:32 pm
by MegumiSawada
Hi Stewart,

Thank you for your quick reply!
I have managed to save a photo as BLOB...!
Thanks again for your advice.

Best Regards,Megumi