network download estimatedBytes always unknown

I want to show the download progress for image files I download from my server and therefor I need the estimatedBytes value but it is always empty or unknown.

Its probably something on the serverside that I have to change.

Anybody has experience with this and might share some knowledge?

Thanks in advance,

Felix

Are you setting progress to true in your headers?

See:

https://docs.coronalabs.com/api/library/network/download.html#download-and-display-remote-image

Rob

Thank you Rob for your answer.

Yes I am setting this parameter and I recieve the event.bytesTransferred correctly.

Just the estimatedBytes never yields a value.

Best,

Felix

You could always try making a network.request() with the “HEAD” verb and see if you get the filesize back there. The server may just not provide it as part of the download() function.

Rob

Hello Rob and thank you for your answer.

The problem was my server not sending the “Content-Length” header … shame on me :confused:

Best,

Felix

Are you setting progress to true in your headers?

See:

https://docs.coronalabs.com/api/library/network/download.html#download-and-display-remote-image

Rob

Thank you Rob for your answer.

Yes I am setting this parameter and I recieve the event.bytesTransferred correctly.

Just the estimatedBytes never yields a value.

Best,

Felix

You could always try making a network.request() with the “HEAD” verb and see if you get the filesize back there. The server may just not provide it as part of the download() function.

Rob

Hello Rob and thank you for your answer.

The problem was my server not sending the “Content-Length” header … shame on me :confused:

Best,

Felix