box / box-android-sdk

Apache License 2.0
62 stars 74 forks source link

Download progress listener returns invalid totalBytes value #419

Closed fistuk closed 4 years ago

fistuk commented 4 years ago

While using the download api:

fileApi.getDownloadRequest(outputStream, id)
                        .setProgressListener { numBytes, totalBytes ->
                            val progress = numBytes / totalBytes
                        }.send()

The totalBytes value returned is always -1. Box SDK version: 5.0.0

doncung commented 4 years ago

Are you able to add a break point to BoxRequestDownload in the onResponse method? The length comes from the header the api call for "Content-Length". Certain apis such as avatars may not support the header, but I tried on a normal file and did see it. It would be helpful if you can provide the type of file, its size, etc...

PJSimon commented 4 years ago

Hi @fistuk, I just wanted to add an @-mention so you could see @doncung 's comment, above. If that helps you, or you need more help, please let us know!

PJSimon commented 4 years ago

Closed by accident! :^) Will wait to hear back from @ fistuk before closing...

PJSimon commented 4 years ago

Hopefully you're all set @fistuk! If not, please feel free to re-open!