I am using this code below for download file:
- (void)downloadFileContentWithService:(GTLServiceDrive *)service
file:(GTLDriveFile *)file
completionBlock:(void (^)(NSData *, NSError *))completionBlock {
if (file.downloadUrl != nil)
{
GTMHTTPFetcher *fetcher =
[service.fetcherService fetcherWithURLString:file.downloadUrl];
[fetcher beginFetchWithCompletionHandler:^(NSData *data, NSError *error) {
if (error == nil) {
// Success.
completionBlock(data, nil);
} else {
NSLog(@"An error occurred: %@", error);
completionBlock(nil, error);
}
}];
} else {
completionBlock(nil,
[NSError errorWithDomain:NSURLErrorDomain
code:NSURLErrorBadURL
userInfo:nil]);
}
Seems everything goes well and after some time I retrieve my file from the server. But the problem that the file size is About 250 MB.
My question is will app crash on the device if the file size is too big. Do we need to make some restriction or something like this. I have downloaded pdf file.