PDA

View Full Version : How to send a picture file to the database from a mobile app?



rhoward
2016-02-21, 23:46
Hi all,

In the mobile app that I'm building the user should be able to upload pictures (either from the camera or file storage) to be stored in a table similar to how in the Southwind database the Employees have their pictures stored. I think I understand how to get that picture in my mobile app, but once I do how do I go about uploading it to my cloud server? I'm having difficulty finding documentation on the subject.

Thanks,
Ryan

barrymavin
2016-02-22, 00:39
It is data bound. Just touch the picture and you can choose to take a photo or select an existing one. It is uploaded automatically for you and either inserted or updated in the table it is bound too.

rhoward
2016-02-22, 17:08
Oh sorry Barry I don't think I explained what I want to do properly. The user clicks a button and gets the file or camera choice then takes a photo/chooses a file which then gets uploaded to the table on my server. I can do the first part currently using Lianja.getPicture() in my click delegate. I just don't know how to go from there to having the file uploaded and stored in my table. I'm guessing I can do something in the onSuccess callback, just not sure how to do it.

barrymavin
2016-02-22, 19:12
If you want to do it that way there is more involved as you need to manually upload and call a server side rsp page to handle the decoding of the image and then store it in a table.

Data binding does that for you. If you have an "upload page" with an image preview above the button would that work for your use case?

If not the solution is more involved.