[英]Phonegap / Cordova File Transfer Upload Image as Base64 String not working in ios
我正在努力将图像作为base64图像流从phonegap / cordova应用程序上传,它在Android中工作得非常好,但在ios中不起作用,但是在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);
}
使用base64使用phonegap上传时,将chunkMode设置为true
我设置chunkMode为true但仍然没有在服务器上传输文件。似乎cordova文件传输插件不支持在iOS上上传的base64图像。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.