【问题标题】:How to write Api method to Upload Image to Google Cloud Storage using Google Cloud Endpoint如何使用 Google Cloud Endpoint 编写 Api 方法以将图像上传到 Google Cloud Storage
【发布时间】:2017-04-22 07:57:03
【问题描述】:

我想在 Google Cloud Endpoint 中编写用于将图像上传到 Google Cloud Storage 的 API。
平台:Google Cloud Endpoint (Java)
后端连接,如数据库连接:Google Cloud Datastore。
另外,上传图片使用哪种数据类型? 请帮帮我。

【问题讨论】:

  • 你要从哪个前端上传图片?网页浏览器?安卓应用? iOS 应用?
  • 安卓和iOS

标签: google-cloud-storage google-cloud-datastore google-cloud-endpoints


【解决方案1】:

如果您进一步查看 StackOverflow,您会发现对于这种特殊情况,人们建议不要通过 Endpoints。

对于 Android,请参阅 Uploading image from Android to GCSupload image to google cloud storage with an application android

既然知道bucket和文件名,那么上传文件的URL就很容易被扣分,请参考以下文档来决定使用哪个URL(取决于用户是否需要认证,参见“用户是授予对对象的读取访问权限") https://cloud.google.com/storage/docs/cloud-console#_accessing

【讨论】:

  • 嗨,我可以从 GCS 上传文件。我也获得了该图像的公共链接,但是,我想要的是 1. 将从 Web 服务中的 IOS/Android 应用程序接收图像。 2. 通过GCE Java web service将图片文件存入bucket。 3. 访问指定URL的图片。
  • 我了解当您说“来自网络服务中的 IOS/Android 应用程序”时,您所说的网络服务是指“Google Endpoints”。换句话说,您确实想通过 Google Endpoints 进行 1、2 和 3。我说的对吗?
  • 对于 iOS,我帮不了你。您应该在网络上搜索 SO 或其他来源。
猜你喜欢
  • 1970-01-01
  • 2016-11-09
  • 2017-08-11
  • 1970-01-01
  • 1970-01-01
  • 2020-11-12
  • 1970-01-01
  • 2020-06-13
  • 2017-04-10
相关资源
最近更新 更多