i wonder if there's anyone who tried to take a image using a steroids application and post it to a backend through api?
The only thing i found about image handling in their own documentation is how to capture images and how to save them in a base64 encoding, but how do i use the base64 encoded image and is there possible to post them through an api?
code example:
$scope.startCapture = function () { navigator.camera.getPicture(onSuccess, onFail, { quality: 50, destinationType: Camera.DestinationType.DATA_URL }); }
function onSuccess(imageData) {
var image = document.getElementById('myImage');
image.src = "data:image/jpeg;base64," + imageData;
}
function onFail(message) {
alert('Failed because: ' + message);
}
i'm not familiar with your environment and hope that i understand your problem correctly, but a base64 encoded Image is nothing more than a string. You can use them like a physical Image i.e. in a Stylesheet like this:
To send this Image through an HTTP-Request to an API, you can put the value in the Request like in the following simple Example (jQuery). Be sure you POST them, GET cant handle infinity Data Length (POST cant even, but its configurable up to 2GB [in PHP]) and an image converted to base64 has significantly more data than the original Image (i.e. 5%-10%)