我正在使用Ionic和ngCordova File Transfer plugin开发Android应用程序,以将文件上传到Amazon S3。但是,上传的文件似乎有额外的内容,例如Content-Disposition...
,如下所示:
--+++++
Content-Disposition: form-data; name="file"; filename="IMG_20150817_205738_1439818078787.jpg"
Content-Type: image/jpeg
<ORIGINAL FILE CONTENT GOES HERE>
--+++++--
我的代码如下:
$cordovaFileTransfer.upload(signedPutUrl, fileUrl, {
fileKey: "file",
fileName: fileName,
mimeType: 'image/jpeg',
chunkedMode: false,
httpMethod: 'PUT',
encodeURI: false,
params: {
"Content-Type": "application/octet-stream"
}
}, true)
为什么会这样,我该如何避免这种情况?