React-native-fs: need help, RNFS.donwloadFile progress

Created on 12 Jan 2017  路  6Comments  路  Source: itinance/react-native-fs

progress: function (res) {
if (res.contentLength == res.bytesWritten) {
console.log('donwload finish');
}
}

in android when progress is finished, The value of res.bytesWritten not same with res.contentLength
can I used callback function when download is finished?

question

Most helpful comment

Hello guys, i have problem with returned values from progress response .. when file is in progress, response returned contentLength -1 why?

All 6 comments

i got the same problem. Did you solve the problem?
@xabree

Please post the values of "bytesWritten" and "contentLength" to give an example

Hello guys, i have problem with returned values from progress response .. when file is in progress, response returned contentLength -1 why?

I never experienced this issue while using it in 3 separate Apps. Can you double check using curl what your server will respond?

@itinance You're right, the server does not return the length information

any callback event when download completed?

Was this page helpful?
0 / 5 - 0 ratings