[英]How can I Update Blogpost Featured Image in Firebase Storage?
我正在尝试使用带有 ReactJS 的 firebase 存储用我的博客文章中已经存在的图像替换图像。 但是,它上传但没有替换旧的,而是创建了没有图像的副本。 这是代码,谁可以帮忙,谢谢。
handleUploadSuccess = filename => {
this.setState({
editImage: filename,
progress: 100
})
firebase.storage().ref('featureds').child(filename).getDownloadURL()
.then(url => this.setState({
editImageURL: url
}))
}
我已经想出了解决办法。 代码是正确的,问题出在传递 firebase 参数,以这种方式实现
this.props.firebase.blog(blog.uid).set({...
而不是这个
this.props.firebase.blog(this.props.match.params.id).set({...
谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.