gpt4 book ai didi

ios - Phonegap/Cordova 文件传输上传图像作为 Base64 字符串在 ios 中不起作用

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:16:29 26 4
gpt4 key购买 nike

我正在从 phonegap/cordova 应用程序上传图像作为 base64 图像流,它在 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);
}

最佳答案

文件传输插件的 1.5.0 版已经添加了该功能。该补丁已于 2015 年 12 月 14 日应用。

您可以看到提交 here .

升级插件至少解决了我的问题。

关于ios - Phonegap/Cordova 文件传输上传图像作为 Base64 字符串在 ios 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27894534/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com