我正在尝试将图像从设备直接上传到 s3。我能够读取图像元数据并将其发送到服务器以生成 aws s3 的预签名 URL。我也有预签名的网址,我想上传文件/图像,axios
但不知何故图像/文件没有上传。这是我的代码。
图像数据(由 ImagePicker 读取)
data: "" // image raw data
fileName: "acx.jpg"
fileSize: ""
uri: ""
path: ""
用于将所选图像发送到 aws s3 的代码。
const options = { headers: { 'Content-Type': fileType}};
axios.put(res.data.signedRequest, data , options);
我得到以下响应。
res = {
config:
data: ""
status: 200
StatusText: undefined
...
}
那么我应该在axios
请求中作为数据传递什么?