Hi I am downloading a media file of 3 MB from Google Drive. The file finish downloading after 82 kb.. it is not downloading completely. I have checked with small file.. but the download size remains constant for any size of file.. that is 82 kb..
I am trying GTMHTTPFetcher to download..but getting error
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
GTLDriveFile *file;
NSString *downloadedString = file.downloadUrl; // file is GTLDriveFile
NSLog(@"%@",file.downloadUrl);
GTMHTTPFetcher *fetcher = [self.driveService.fetcherService fetcherWithURLString:downloadedString];
[fetcher beginFetchWithCompletionHandler:^(NSData *data, NSError *error)
{
if (error == nil)
{
if(data != nil)
{
GTLDriveFile *file = [driveFiles objectAtIndex:indexPath.row];
filename=file.title;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
filename = [[paths objectAtIndex:0]stringByAppendingPathComponent:[NSString stringWithFormat:@"%@",fileNames]];
NSData* Data = [[NSData alloc]initWithContentsOfURL:targetURL];
[Data writeToFile:filename atomically:YES];
NSLog(@"my path:%@",filename);
}
}
else
{
NSLog(@"Error - %@", error.description);
}
}];
// from the above code error is **Domain=com.google.GTMHTTPFetcher Code=-1 "The operation couldn’t be completed. (com.google.GTMHTTPFetcher error -1.)"**