【发布时间】:2020-05-10 10:58:34
【问题描述】:
我尝试了这篇文章中的示例How to delete a Firebase Storage file with flutter?
但它没有工作。这是我尝试过的:
String filePath = 'https://firebasestorage.googleapis.com/v0/b/amct-47348.appspot.com/o/ClassificadoImages%2F1579839318515.jpg?alt=media&token=cd8880eb-8b37-45e4-8dc1-e75de0c5f7cb'
.replaceAll(new RegExp(r 'https://firebasestorage.googleapis.com/v0/b/amct-47348.appspot.com/o/ClassificadoImages%2F'), '').split('?')[0];
FirebaseStorage.instance.ref().child(filePath).delete()
.then((_) {
print('Successfully deleted $filePath storage item');
}).catchError((e) {
print("err: $e");
});
这是它返回的内容:
I / flutter(4920): err: PlatformException(deletion_error, Object does not exist at location., null)
可以对它返回错误的原因提出一些想法,因为它与示例完全相同。感谢阅读。
【问题讨论】:
标签: flutter google-cloud-storage firebase-storage