views:

453

answers:

1

I am downloading some very large data from a server with the NSURLConnection class.

How can I implement a pause facility so that I can resume downloading?

+5  A: 

You can't pause, per-se, but you can cancel a connection, and then create a new one to resume where the old left off. However, the server you're connecting to must support the Range header. Set this to "bytes=size_already_downloaded-", and it should pick up right where you cancelled it.

Ben Gottlieb