Jon Fusco
Posts: 0
Joined: Sun Apr 13, 2014 11:37 pm

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

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

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

Hello!

Working on it. I will update.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

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

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.

Return to “Issues”