Page 1 of 1

Database image to base64 via Javascript

Posted: Sun Jan 25, 2015 4:07 am
by Andrew Davidsburg

Hi I am trying to pull images from my database into base64 to store in an indexeddb locally via a javascript call. I'm using the code below to pull the image but the data isn't returned in anything I can work with.

get_image_from_db.execute({
query: {
file_name: flight_1['_id']
},
complete: function(data) {
console.log(data.responsText);
}

Code: Select all

     }); 

Thanks!

Andrew


Database image to base64 via Javascript

Posted: Sun Jan 25, 2015 4:56 am
by M&M

How about doing a mapping like this to a image component like this

Image

And check out the data being returned in the JS. That i believe is the base64 data that you can work with...

I think you may even be able to map the data to a local storage variable and then work on that

Cheers,
M&M