0
votes

How can I receive gzipped data length in bytes? NSURLConnection automatically decompress gzip data, and I can receive length in bytes only for decompressed data. But I need to know length for compressed data, so what size it go from serevr

1
You cannot know the true size of the data in a gzipped archive until you decompress it. - Donovan
@Donovan I believe the question was about the size of the gzipped data before decompression. - neilco
@neilco I read the question as 'it tells me the size of the compressed file, but then decompresses it before download', which seems silly, so maybe you're right. - Donovan
Can you please clarify this for us @user3095583? - Donovan

1 Answers

1
votes

Take a look at the Content-Length header of the NSURLResponse. This will be the length of the gzipped data. This is available via the expectedContentLength property of NSURLResponse.

EDIT: If it's zero, then the server did not set a Content-Length header.