Note that there are some explanatory texts on larger screens.

plurals
  1. POThe File is not writing to the Document Directory?
    primarykey
    data
    text
    <p>// I am trying to download file from google drive i am able to list file in nslog with its size but not able to write in document Directory. Currently It save a pathwith extension but not saving the original file.</p> <pre><code>GTLDriveFile *file; NSString *downloadedString = file.downloadUrl; // file is GTLDriveFile GTMHTTPFetcher *fetcher = [self.driveService.fetcherService fetcherWithURLString:downloadedString]; filename=[[NSString alloc]init]; [fetcher beginFetchWithCompletionHandler:^(NSData *data, NSError *error) { GTLDriveFile *file = [driveFiles objectAtIndex:indexPath.row]; filename = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSLog(@"\n\n\n\n\n"); NSLog(@"This is File Size=====&gt;%@",file.fileSize); NSLog(@"This is file Name===&gt;%@",file.title); if(file.downloadUrl!= nil) { filename=file.title; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; documentsDirectory = [[paths objectAtIndex:0]stringByAppendingPathComponent:[NSString stringWithFormat:@"%@",filename]]; [data writeToFile:documentsDirectory atomically:YES encoding:NSUTF8StringEncoding error:nil]; NSLog(@"my path:%@",documentsDirectory); } else { NSLog(@"Error - %@", error.description); } }]; // ya i got it... NSString *downloadURL=[[self.driveFiles objectAtIndex:indexPath.row] downloadUrl]; GTMHTTPFetcher *fetcher = [self.driveService.fetcherService fetcherWithURLString:downloadURL]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload