title: IOS: How to upload a file to specific Google drive folder using Google drive sdk library
body: <p>I integrated Google drive sdk with my iOS app. But I do not know how to upload a file to Google drive specific folder. </p>
  
  <p>Here the code am using to upload the file. But this one uploading the file to my google drive root folder. Any one share a code to upload a file to google drive specific folder?.</p>
  
  <p><strong>My Code:</strong></p>
  
  <pre><code>-(void)uploadFileToGoogleDrive:(NSString*)fileName
  {    
  GTLDriveFile *driveFile = [[[GTLDriveFile alloc]init] autorelease];
  
  driveFile.mimeType = @"application/pdf";
  driveFile.originalFilename = @"test.doc";
  driveFile.title = @"test.doc";
  
  NSString *filePath = [LocalFilesDetails getUserDocumentFullPathForFileName:fileName isSignedDocument:YES];
  
  GTLUploadParameters *uploadParameters = [GTLUploadParameters
                                           uploadParametersWithData:[NSData dataWithContentsOfFile:filePath]
                                           MIMEType:@"application/pdf"];    
  
  GTLQueryDrive *query = [GTLQueryDrive queryForFilesInsertWithObject:driveFile
                                      uploadParameters:uploadParameters];
  
  [self.driveService executeQuery:query 
    completionHandler:^(GTLServiceTicket *ticket,
                         GTLDriveFile *updatedFile,
                         NSError *error) {
      if (error == nil) {
          NSLog(@"\n\nfile uploaded into google drive\\&lt;my_folder&gt; foler");
      } else {
          NSLog(@"\n\nfile uplod failed google drive\\&lt;my_folder&gt; foler");            
      }
  }];
  }
  </code></pre>