Joseph Francis
Posts: 0
Joined: Thu Sep 04, 2014 8:52 pm

uploading image from camera to files collection

I've been working on this for a few days, and kind of up against a wall.

the "Input type="File" not working on Android" problem is well known at this point, so the appery tutorial on uploading files "http://devcenter.appery.io/tutorials/uploading-files-to-appery-io-database/" doesn't work for my android device. Literally nothing happens.

I am able to capture an image, of course, with the image service per tutorial, "http://devcenter.appery.io/tutorials/using-the-camera-component/" which is pretty straightforward.

The problem I have is I want to upload the image I capture with the camera to the appery file collection. The appery REST service for uploading files body has a single parameter "Data", which is about as generic as you can get. There is no documentation that I can find on what the mysterious "data" field is supposed to be, and the documentation on "uploading files" at "http://devcenter.appery.io/documentation/backendservices/database/#File_API" doesn't say anything at all other than "via JavaScript code." which in turn points back to using "input type=file" interface which doesn't work for Android, which is where I started.

Can I get a detailed example, with illustrations, on how to

  • take a picture with a camera
  • send the data to the appery "files" collection
    using standard mapping/services calls

I'm surprised I'm really the first one who has asked for an example or tutorial for taking a picture and storing it on an android platform.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

uploading image from camera to files collection

Hi Joseph,

Here is a brief plan for this question:

  1. Get base64 image source from camera service. How to do it - read here: http://devcenter.appery.io/tutorials/...

  2. Upload base64 source into Files system colleciton.
    How to do it - you can find here: https://getsatisfaction.com/apperyio/...

    Regards.

Joseph Francis
Posts: 0
Joined: Thu Sep 04, 2014 8:52 pm

uploading image from camera to files collection

Adding the data works fine, and a file is created, but no matter what I do, the camera service will not provide me with a base64 data element, it always returns a blank.

I've correctly set the "Data URL" option, but only the ImageURI field is populated.

I deleted the camera function and added it back, trying again, but it still only sends back the ImageURI with the "Data URL" option set.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

uploading image from camera to files collection

Hi Joseph,

I've tried that (set destination as "data_url") and get "imageDataBase64" correct response parameter.

Please give us your app public link and describe steps to reproduce this problem in your app(can not get "imageDataBase64").

Also please specify your device OS version.

Regards.

Return to “Issues”