I need to implement file upload for my application. Files, such as Assets (which can be photos or videos), must be uploaded to the web server using the REST interface.
The download will use a form data request with custom header attributes.
Problem: Holding large files, such as video in an NSData object, can lead to memory problems. This will be a standard approach.
Solution Providing NSInputStream for the main part of the request - and writing the data in parts to the HTTP stream stream.
Question Can someone provide an example of using NSInputStream in combination with NSURLrequest and NSURLConnection ?
I wrapped my head around a few incomplete examples -
but i don't know how to handle the following method
- (NSInputStream *)connection:(NSURLConnection *)connection needNewBodyStream:(NSURLRequest *)request
I do not want to use a third-party library.
source share