[英]Resumable upload to Google Cloud Storage from Android with progress bar
We are building an app that needs to upload a lot of images and videos directly to the GCS. 我们正在构建一个需要直接将大量图像和视频上传到GCS的应用。 While uploading each file, we need the upload status to be displayed in a progress-bar.
上载每个文件时,我们需要在进度栏中显示上载状态。
How can I get the number of bytes transmitted? 如何获得传输的字节数?
I have gone through this link . 我已经通过这个链接。 But I couldn't find how to get the progress on the upload.
但是我找不到如何获得上传进度。 How do I do this?-
我该怎么做呢?-
If you read down a little further to the section Uploading the file in chunks
you will read this 如果您进一步阅读“分
Uploading the file in chunks
”部分Uploading the file in chunks
则将阅读此内容。
Use the upper value returned in the Range header to determine where to start the next chunk.
使用Range标头中返回的上限值来确定从下一个块开始的位置。 Continue to PUT each chunk of the file until the entire file has been uploaded.
继续放置文件的每个块,直到上传了整个文件。
so you can get that information from the Range
header from the response 因此您可以从响应的
Range
标头中获取该信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.