Closed jcaron144 closed 6 years ago
Hi,
You can get the progress of downloading with some further works. Downloading is running on another thread: https://github.com/midworld/unity-googledrive/blob/7be81c0ac570a7588d65ed8cf34ab858613b6c78/Assets/GoogleDrive/UnityWebResponse.cs#L65
If Google Drive gives 'Content-Length', you can get the progress easily. Just write current downloaded byte count and the content length to public properties of UnityWebResponse
. You should consider thread-safety when update these value(probably use lock
).
If Google Drive doesn't give 'Content-Length', it might be a 'chunked' encoded stream. In this case you couldn't know the length of the file. So you should query stats of the file to get the whole file size first.
Thanks.
Great, I was able to create a progress event to listen to. Thanks again!
Hello, When downloading a large file it would be nice to see the progress on the download. I have tried logging the response.progress, but that always returns 0.
Shouldn't this Log statement return a progress float?:
Oops, on further investigation, I added the progress value at a previous time in an attempt to populate it -- it does not exist in the current source code. Is there any way to easily get it?