【问题标题】:Resumable upload to Google Cloud Storage from Android with progress bar使用进度条从 Android 恢复上传到 Google Cloud Storage
【发布时间】:2016-03-03 16:05:21
【问题描述】:

我们正在构建一个需要将大量图像和视频直接上传到 GCS 的应用。在上传每个文件时,我们需要在进度条中显示上传状态。

如何获取传输的字节数?

我已经浏览了this 链接。但我找不到如何获得上传进度。我该怎么做?-

【问题讨论】:

    标签: android file-upload progress-bar google-cloud-storage


    【解决方案1】:

    如果您进一步阅读Uploading the file in chunks 部分,您将阅读此内容

    使用 Range 标头中返回的上限值来确定在哪里 开始下一个块。继续 PUT 文件的每个块,直到 整个文件已上传。

    这样您就可以从响应的 Range 标头中获取该信息

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-27
      • 1970-01-01
      • 2016-06-17
      • 2021-11-22
      • 2013-05-08
      • 2013-12-14
      • 2013-01-12
      • 2018-04-20
      相关资源
      最近更新 更多