alancc
alancc

Reputation: 811

IBindStatusCallback in URLDownloadToFile does not return the final file size properly

I use the code similar to that in Why UrlDownloadToFile::OnProgress always return ulProgress and ulProgressMax with the same value. I expect the ulProgress will be the number of bytes downloaded. However, when I try to download a large file(61,829,200 bytes), the last call to the callback function pass ulProgress as 61,812,069, not same as the final size. Does that mean the file is not downloaded completely? I try to check the downloaded file but find its size is 61,829,200 bytes, not 61,812,069bytes.

Why?

Upvotes: 0

Views: 312

Answers (1)

alancc
alancc

Reputation: 811

I have found the issue. When status code is BINDSTATUS_DOWNLOADINGDATA, the ulProgress will not reach the final size. There will be another status code BINDSTATUS_ENDDOWNLOADDATA, when that status code appears, then the ulProgress is the final size.

Upvotes: 1

Related Questions