GCP存储桶 - 创建链接以上传

发布于 01-19 09:21 字数 167 浏览 3 评论 0原文

我看了看,但似乎看不到这是如何做到的。

我有一个GCP存储桶,可以公开访问。我需要一个链接来提供一个可以使用的助理,将某些文件上传到该存储桶中。不需要身份验证,无论如何,文件只是公共域。我需要该过程对同事来说非常简单。

上传文件后,我可以抓住它们并破坏存储桶/项目。

这可能吗?

I've looked all over but can't seem to see how this might be done.

I have a GCP bucket, which is publicly accessible. I need a link to give to an associate which they can use to upload some files into that bucket. There is no need for authentication, the files are just public domain anyway. I need the process to be super simple for the associate.

Once the files are uploaded I can grab them and destroy the bucket/project anyway.

Is this possible?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

逆流 2025-01-26 09:21:02

使用签名的url 。从文档(强调地雷)中:

在某些情况下,您可能不想要求用户拥有一个Google帐户以访问云存储,但是您仍然需要使用特定于应用程序的逻辑来控制访问。解决此用例的典型方法是为用户提供签名的URL,该URL可在有限的时间内读取,写入或删除对该资源的访问。创建签名URL时,您指定了有效期的时间。任何知道URL的人都可以访问资源,直到达到URL的到期时间或用于签署URL的钥匙是旋转的。

Use a signed URL. From the documentation (emphasis mine):

In some scenarios, you might not want to require your users to have a Google account in order to access Cloud Storage, but you still want to control access using your application-specific logic. The typical way to address this use case is to provide a signed URL to a user, which gives the user read, write, or delete access to that resource for a limited time. You specify an expiration time when you create the signed URL. Anyone who knows the URL can access the resource until the expiration time for the URL is reached or the key used to sign the URL is rotated.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文