Phonegap / Cordova File Transfer Upload Image as Base64 String not working in ios
I am working on loading image as base64 image stream from phonegap / cordova app, it works fine on android but doesn't work in ios, however in ios it works when the image is png / jpg but when it's base64 the image stream its not working please someone can help me with the same.
Here is my code for the same,
var options = new FileUploadOptions();
options.fileKey = "file";
options.fileName = "test.jpg";
options.mimeType = "image/jpeg";
options.chunkedMode = false;
options.params = {
"key": "test.jpg",
"AWSAccessKeyId": awsKey,
"acl": acl,
"policy": policyBase64,
"signature": signature,
"Content-Type": ""
};
var ft = new FileTransfer();
ft.upload(imageURI, s3URI + "",
win, fail, options);
}
function win(r) {
console.log("Code = " + r.responseCode);
console.log("Response = " + r.response);
console.log("Sent = " + r.bytesSent);
alert(r.response);
}
function fail(error) {
alert("An error has occurred: Code = " + error.code);
}
+3
source to share
3 answers