如何解决存储桶名称必须以数字或字母开头和结尾
我正在尝试将 .sav
文件上传到 Firebase 存储。但每次我尝试上传时,我都会收到此错误:ValueError: Bucket names must start and end with a number or letter.
我在网上找到的教程/问题都没有解决此问题。
我这样做的方式是:
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = 'credentials.json'
storer = storage.Client()
bucket = storer.get_bucket('gs://project_name.appspot.com/') #I found this on the top of my storage account.
有什么想法吗?
解决方法
get_bucket 使用不带“gs://”和尾部斜杠(不是数字或字母,因为错误消息提醒您)的存储桶名称。
bucket = storer.get_bucket('project_name.appspot.com')
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。