Closed LywLover closed 4 years ago
When you download them what "asResult" method are you using? asFile()
? or something else?
I using asFile()
I've got a version of this working locally. It needs a little cleanup. I'll probably release something this weekend.
However, just a warning. The length of the body is not entirely determinable. We will use the following in order:
available
bytes from the input stream which is maybe a horrible thing to try and use. I'm going to do some tests with different downloads to see how accurate it is. If it's not accurate at all I might just say it's Content-Length or nothing.Both of these are impacted by streaming connections. If the server just keeps feeding bytes without telling me the length then Unirest is just going to keep reading until it's gone. We will hit up the monitor on the buffer but there is a chance the total size will be zero. This might be ok for a spinner, but not great for a bar or estimated time of completion.
(if you or anyone else has some magical way of knowing the length of an input stream without reading it I'm more than open to suggestions)
complete in 3.6.00
Is your feature request related to a problem? Please describe. I need download large files and provide some time of progress bar to a user
Describe the solution you'd like Add Download Progress Monitor like uploadMonitor :)