Page 1 of 1

Photos in Camera Service with Data URLs How Can I view them?

Posted: Thu May 29, 2014 1:34 pm
by Jon Fusco

I'm new to this so if this is an obvious question I apologize.

I saw a tutorial about how to download a File from the Filemanager within Appery but nothing for the PhoneGap camera service specifically. My image files are in another collection called "inventory".

I have my camera service set to 'Data URL' to save image files in the Appery DB.

  1. I want to to move these to a my web server via FTP so they have a regular URL like http://xxxxxx.com/image.jpg. How is this accomplished?

  2. Are the photos already hosted from a URL on the Appery server?

  3. How can I view that file if it has a URL like data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxQQEBUUEBQWFBUVFBgVFRQYF...

    I have already reviewed PhoneGap docs and Appery Docs could not find an answer.

    Thanks
    Jon


Photos in Camera Service with Data URLs How Can I view them?

Posted: Fri May 30, 2014 8:53 am
by Maryna Brodina

Hello!

Working on it. I will update.


Photos in Camera Service with Data URLs How Can I view them?

Posted: Fri May 30, 2014 9:18 am
by Kateryna Grynko

Hi Jon,

1) You can do this if there is a possibility to add files via REST service on your server.

2) Most probably, you save images as base64 strings that is why they don't have a URL in Database. You can convert them to usual images using a function atob() (https://developer.mozilla.org/en-US/d...)

3) This is a file encoded as base64 string. If this is an image, just set Image component attribute src=this string, if the file is of another type, you can decode it as described above.