mobozi.init('123456789');
function uploadImage(){
var myFile = document.getElementById('idimage').files[0];
var imageData = {
"file": myFile
}
mobozi.image.uploadGetUrl(imageData,function(response) {
if (response.status == 201){
$('#imgUrl').html('URL: ' + response.data.imageUrl);
$('#upImage').attr('src',response.data.imageUrl);
} else {
alert (response.error);
}
});
}
<input id="idimage" name="idimage" type="file" accept="image/*"/>
<button type="button" id="btnup" onclick="uploadImage();">Upload Image</button>
<div id="imgUrl"></div>
<div><img id="upImage" src=""></div>
External resources loaded into this fiddle: