When use use getPicture either we get a relative URL or base64image. But I want to send a image object to Amazon S3. Anyway to do that ?
Here is how I am getting the base64image
// A button will call this function
//
function capturePhoto() {
// Take picture using device camera and retrieve image as base64-encoded string
navigator.camera.getPicture(onPhotoDataSuccess, onFail, {
destinationType: Camera.DestinationType.DATA_URL,
quality: 50
});
}
[UPDATE] Now I need to get the image as object convert it to byte array and upload it to Amazon S3 using REST (PUT) call.
Similarly you can also load byteStream to the image tag
sure you can
camera/image source code
html
js
file transfer source code
js
php
References:
http://blog.revivalx.com/2014/05/03/tutorial-camera-cordova-plugin-for-ios-and-android/ http://blog.revivalx.com/2014/07/12/upload-image-using-file-transfer-cordova-plugin-for-ios-and-android/