【问题标题】:Pydrive: How to upload a large file or in chunks?Pydrive:如何上传大文件或块?
【发布时间】:2020-09-24 20:52:10
【问题描述】:

我正在尝试通过 PyDrive 将一个大的 csv 压缩文件 (~6GB) 上传到 Google Drive,但每次我尝试通过以下方式进行上传:

file = self.drive.CreateFile({
  'title': file_name,
  'parents': [{ 'id': parent_id }],
  'mimeType': mime_type,
})
file.SetContentFile(file_path)
file.Upload()

我收到以下错误: httplib2.RedirectMissingLocation: Redirected but the response is missing a Location: header..

我使用的是 Python 3.7。

有人知道我是否可以通过 Pydrive 上传大文件或逐块上传吗?

提前致谢!

【问题讨论】:

    标签: python-3.x google-drive-api pydrive


    【解决方案1】:

    尝试改用 pydrive2 库。 https://github.com/iterative/PyDrive2。它没有文件大小的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-01-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-06-29
      • 2011-08-29
      • 1970-01-01
      相关资源
      最近更新 更多