将文件从保管箱/驱动器传输到 Google 云存储

人气:390 发布:2022-10-16 标签: google-drive-api google-cloud-storage dropbox-api

问题描述

我们计划实施一项功能,让客户可以在自己的 Google Drive 或 Dropbox 帐户(在我们的应用中)浏览他们的图片,并选择他们想在我们的应用中使用的图片.然后,我们会将这些图像保存到我们的 Google 云存储 (GCS) 位置.

We are planning to implement a feature to let customers browse their images in their own google drive or dropbox accounts (within our app), and select ones they wanna use in our app. Then, we will save these images into our Google cloud storage (GCS) place.

一个简单的方法是使用 OAuth 将客户的图像从 dropbox/drive 下载到我们的本地磁盘,然后将它们上传到我们的 GCS.

A simple approach is to use OAuth to download the customers' images from dropbox/drive to our local disk, then upload them to our GCS.

我想知道是否可以在保管箱/驱动器和 GCS 之间进行直接传输?GCS 确实为 S3 提供了传输服务.您也可以创建一个 URL 列表列表,但每个 URL 都需要可公开访问,这在我们的例子中似乎是不可能的.

I am wondering if it is possible to make a direct transfer between dropbox/drive and GCS? GCS does provide transfer service for S3. You can also create a list of URL list, but each URL needs to be publicly accessible, which in our case does not seem possible.

关于如何实现此功能有更好的建议吗?谢谢

Is there any better suggestion on how to implement this feature? Thanks

推荐答案

好吧,您可以流式传输文件,这样至少您不必将它们保存到本地磁盘,但除此之外,我认为您的解决方案是去吧.

Well you could stream the files so at least you wouldn't have to save them to local disk, but other than that I think your solution is the way to go.

这取决于您的语言如何准确地进行流式传输,但基本上您可以立即下载文件并将其上传到 GCS,而无需将任何字节写入本地磁盘.

It depends on your language how streaming works exactly, but basically you download the file and upload it to GCS right away without ever writing any bytes to local disk.

632