Отправить запрос следующим образом.
NSURL *url = [NSURL URLWithString:[fileUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
theRequest = [NSMutableURLRequest requestWithURL:url];
[theRequest setValue:[NSString stringWithFormat:@"bytes=%ld-",0] forHTTPHeaderField:@"Range"];
[theRequest addValue: @"pdf" forHTTPHeaderField:@"Content-Type"];
[theRequest setHTTPMethod:@"POST"];
webData = [[NSMutableData alloc] init];
theConnection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self startImmediately:YES];
Реализация следующих методов ...
-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
[webData appendData:data];
}
-(void)connectionDidFinishLoading:(NSURLConnection <em>)connection
{<br>
/<strong></em>**<em>*</em>***</strong><em>CODE FOR WRITING FILE</em><strong><em>*</em>**<em>*</em>**<em>*</em>**<em>*</em>***</strong>/
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);</p>
<pre><code>NSString *documentPath = [paths objectAtIndex:0];
NSString *directoryPath = [documentPath stringByAppendingPathComponent:[MAIN_DIRECTORY stringByAppendingPathComponent:fileDate]];
[[NSFileManager defaultManager] createDirectoryAtPath:directoryPath withIntermediateDirectories:NO attributes:nil error:nil];
[webData writeToFile:fileName atomically:YES];
}