在 Google Drive 或 Dropbox 中托管图像以供应用使用

Hosting images in Google Drive or Dropbox for app usage

我有一个名为 Moodflow 的情绪跟踪应用程序,我正在尝试将图像添加到应用程序/用户条目。我正在考虑使用 firebase storage 来存储我的高级用户的图像,但我有点担心保存太多图像并且成本会失控。

我看到其他日记应用程序使用 Google Drive 和 Dropbox 作为备份功能(大多数只是 JSON 数据)但是我不确定这些平台在我上传用户图片时的表现如何用于托管(和备份)。我可以首先在 Google Drive 或 Dropbox 中提升图像吗?这是一个可行的解决方案吗?

这个能不能连这个网上好像也有很多乱码。

Google 云端硬盘不支持图像托管,因此它们可以 link 直接嵌入到应用程序或 HTML 内容中。有一个解决方法,您可以通过从 Drive API 获取文件 ID 并将其嵌入 https://drive.google.com/uc?export=view&id=<fileId> 来嵌入图像,但是对于大量共享,不建议这样做,因为它会受到配额使用的限制。

Dropbox 确实支持图像托管,您可以使用 Dropbox API 获取可嵌入图像的 public link。 /shares 端点允许您获取 public 可查看 link via the API.

Firebase 是 Google 的服务,作为 Cloud Storage service. This is also available via the API and so can be retrieved programmatically much like Dropbox. Embedding the Firebase link as the image source allows for usage in external apps and pages. 的一部分支持图像托管可能对此有所帮助。

Dropbox 和 Firebase 均受定价计划约束,根据个人或企业用途以及您需要的存储量,定价计划有不同的层级。 Firebase 有一个即用即付的定价机制,它会根据您使用的存储空间向您收费,这可能会有所帮助,尽管这实际上取决于您需要什么方法和定价。

您可以查看 Dropbox 个人定价计划 here while their business pricing plans are here. Firebase's pricing plans can be seen here。我建议您仔细研究两者,以便根据您的需要做出正确的决定。