从Cordova FileTransfer到S3的文件PUT包含不需要的元数据

时间:2022-11-02 23:04:49

I was able to upload a video file from Cordova to S3 using:

我可以使用以下方法将Cordova的视频文件上传到S3:

options.fileKey = fileName;
options.fileName = fileName;
options.mimeType = "video/mp4";
options.chunkedMode = false;
options.httpMethod = "PUT";

ft.upload(videoURI, signedUploadUrl, ..., ..., options);

The problem is that the file is saved on S3 wrapped with this metadata:

问题是该文件保存在包含此元数据的S3上:

--+++++
Content-Disposition: form-data; name="my_video.txt"; filename="my_video.txt"
Content-Type: video/mp4

<file-content>

--+++++--

How to save the plain content of the file without this text around it?

如何在没有此文本的情况下保存文件的纯文本内容?

1 个解决方案

#1


1  

That was not a problem, actually.

实际上,那不是问题。

The problem was that I had the wrong Content-Type for the files on S3. See the selected answer for this question.

问题是我在S3上的文件有错误的Content-Type。请参阅此问题的所选答案。

#1


1  

That was not a problem, actually.

实际上,那不是问题。

The problem was that I had the wrong Content-Type for the files on S3. See the selected answer for this question.

问题是我在S3上的文件有错误的Content-Type。请参阅此问题的所选答案。