我正在处理从PhoneGap/Cordova应用上传图像作为base64图像流的问题,它在Android上完美地工作,但在iOS上不起作用,尽管当图像为png/jpg格式时,它可以工作,但当它是base64图像流时就无法工作。请问有谁能帮我解决这个问题。
以下是相关代码:
以下是相关代码:
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);
}