Reputation: 6607
Is there a way to query the size of a file that was requested via http in objective c on iphone. I would like to find out file size prior to data being sent back so I can write a simple Download Progress indicator. Your help is much appreciated. Tony
Upvotes: 1
Views: 622
Reputation: 2094
If you're using NSURLConnection to do the download, you can implement connection:didReceiveResponse: in your delegate. When this method is called, you'll be passed an NSURLResponse object that you can call expectedContentLength on.
If you're not using NSURLConnection, you might want to give us a few more details.
Upvotes: 1