I have a working implementation of AFNetworking for downloading entire files (as per the documentation) over an https connection, however I was wondering if there is a way to download ONLY the start of a file so that I can parse some custom header elements stored at the start of the files myself.
Possibilities:
If anyone has any ideas or can point me to documentation regarding this (I can't find any) let me know. Thank you!
I have found the solution! I was thinking about it incorrectly at first by trying to limit AFNetwork or using a callback to stop the download. The solution is in fact much easier...
You need to tell the server that you only need "0 to n" number of bytes in the header of the GET request that you send to the server.
[request.requestSerializer setValue:@"bytes=0-1024" forHTTPHeaderField:@"Range"];
By adding this to the request, you will ask for only the bytes from 0 to 1024.
Hope this helps someone!