ngCordova FileTransfer直接上传到AWS S3 WebKitFormBoundary问题

Ras*_*adi 6 amazon-s3 amazon-web-services node.js cordova ionic-framework

我正在尝试使用带有ngCordova FileTransfer插件的AWS-S3上的预先签名的URL上传文件.

我已成功将文件上传到AWS-S3,但该文件的内容包含

------WebKitFormBoundarylCFgJXqqECF1rJ2m Content-Disposition: form-data; name="file"; filename="75cae09191bd92a16c3ff05baeb88b9b.jpg" Content-Type: image/jpeg

由于哪个图像文件无法打开.如何在我的文件中删除此标头.我有一个想法,如果我把二进制数据而不是表单数据,它将摆脱这个,因为我已经在POSTMAN中测试它,但在cordova文件传输中找不到任何方法.

 $cordovaFileTransfer.upload(s3SignedUrl, imagePathOnPhone, {
                                fileKey: "file",
                                fileName: localFileName,
                                httpMethod: "PUT",
                                mimeType: 'image/jpeg'
                            })
                                .then(function (result) {
                                    console.log(result);

                                }, function (error) {
                                    console.log(error);

                                }, function (progress) {
                                    console.log(progress);

                                });
Run Code Online (Sandbox Code Playgroud)

我的水桶在法兰克福地区和api v4.我在服务器上使用nodejs.

daa*_*edt 1

尝试将该Content-Type属性添加到该params部分。

$cordovaFileTransfer.upload(s3SignedUrl, imagePathOnPhone, {
    fileKey: "file",
    fileName: localFileName,
    httpMethod: "PUT",
    mimeType: 'image/jpeg',
    params: {
        "Content-Type": "image/jpeg"
    }
})
.then(function (result) {
    console.log(result);

}, function (error) {
    console.log(error);

}, function (progress) {
    console.log(progress);

});
Run Code Online (Sandbox Code Playgroud)