【发布时间】:2018-09-29 14:22:06
【问题描述】:
我正在寻找一个完整的示例,说明如何在成功将文件名发送到S3 后返回文件名。
目前我有类似的东西:
uploadImageAsync = async (pickerResult) => {
try {
this.setState({
uploading: true,
})
if (!pickerResult.cancelled) {
const response = await fetch(pickerResult.uri);
const blob = await response.blob();
Storage.put(fileName, blob)
.then(result => console.log(result))
.catch(err => console.log(err))
}
} finally {
this.setState({
uploading: false,
})
}
}
我的返回结果是我创建的文件名。我想在创建后返回 S3 文件名。这可能吗?
【问题讨论】:
标签: reactjs amazon-web-services react-native amazon-s3 aws-amplify