How to get a file size of a CFHTTPStream. Suppose a file called "http://testserver.com/test.jpg " is available to read. Here I need to get the file size "test.jpg", this I need to display progress while using CFReadStreamRead.
Or in other words I need how many bytes are available in the server
before the start of the read process.
Thanks in advance
Mohsin
You would get the message header from the stream thusly:
And then copy out the header fields:
and then grab the content-length field from the dictionary.
I don't completely remember the specific field name so dump the dict & grab the one which looks right. You will need to read at least a little bit of the stream to get the header.