- Home /
Is there a way to estimate file size from www class downloaded from Dropbox
I have some issue with the www class the "www.progress" For iOS and Android.
I have used www to download file from the url from Dropbox. The www.progress worked flawlessly in stand-alone mode, but for iOS and Android www.progress returns random numbers which are incorrect. Or is there any way to achieve this goal for estimate the file size?
I have read all topics around and it's likely to be the "Headers"? We need to read the file size of that one, I presume. Can anyone explain about that?
Noted: www.progress usually returns to 0.5f to 1.0f then looping until it finished loading. It's always more than 0.5f and never start with 0f
Thanks!
Answer by Naphier · Mar 06, 2016 at 09:37 PM
It might be in the response headers
http://docs.unity3d.com/ScriptReference/WWW-responseHeaders.html
If not you'll have to implement dropbox's api to find out. This is the specific API call for HTTP: https://www.dropbox.com/developers/documentation/http/documentation#files-get_metadata
I'm not sure if you need to implement an auth token for a publicly shared file.
You should also be aware that using dropbox to host your files is fine for development, but not for production. There are usage limits which you can quickly hit: https://www.dropbox.com/en/help/4204
The WWW-responseHeader did the trick! Another little question, how can I calculate the file which currently downloading? The www.bytesDownloaded has an Error because it can't be used during download.
In short, I want to show the progress of downloading the File. Any $$anonymous$$gestions?