2013-08-06 30 views
5

Tôi muốn liệt kê các tệp mp3, mp4, mkv, avi, aac, wmv từ Google Drive và Hiện tại tôi chỉ có thể liệt kê các tệp mp3 nhưng tôi muốn liệt kê các tệp mở rộng khác ...
... làm thế nào tôi có thể sử dụng query.q = @ "mimeType = 'audio/mpeg'"; cho nhiều tiện ích mở rộngLàm thế nào để liệt kê nhiều loại tệp Mime từ ổ đĩa Google?

// Tôi đã thử cách này.

-(void)loadDriveFiles 
{ 

GTLQueryDrive *query = [GTLQueryDrive queryForFilesList]; 

query.q = @"mimeType ='audio/mpeg' "; 




UIAlertView *alert = [GoogleUtilities showLoadingMessageWithTitle:@"Loading files" 

                 delegate:self]; 

[self.driveService executeQuery:query completionHandler:^(GTLServiceTicket *ticket, 

                  GTLDriveFileList *files, 

                  NSError *error) 
{  
    [alert dismissWithClickedButtonIndex:0 animated:YES]; 

    if (error == nil) 
    { 

     if (self.driveFiles == nil) 
     {  
      self.driveFiles = [[NSMutableArray alloc] init]; 

     } 

     [self.driveFiles removeAllObjects];   
     [self.driveFiles addObjectsFromArray:files.items];   
     [self.tableView reloadData]; 

    } else { 

     NSLog(@"An error occurred: %@", error); 

     [GoogleUtilities showErrorMessageWithTitle:@"Unable to load files" 

              message:[error description] 

              delegate:self]; 

    } 

}]; 
} 
// Thanks In Advance 
+0

tôi cần sự giúp đỡ của bạn, tôi nghĩ rằng bạn là tốt trong phần tích hợp Google Drive Hãy xem xét điều này liên kết http://stackoverflow.com/questions/18288487/how-to-upload-an-image-on-google-driveerror-assertion-failure-in-gtmhttpupload – Ravindhiran

+0

@Ravindhiran tôi có một số làm rõ Google Drive Issue..if ur miễn phí chỉ cho tôi biết – NextStep

Trả lời

3

Sử dụng toán tử OR trong truy vấn của bạn

Like this mimeType = 'audio/mpeg' or mimeType = 'audio/mp3' 

cho tôi biết làm việc của mình hay không :)

+0

mimeType = 'audio/mpeg' nó đang hoạt động nhưng chỉ liệt kê m p3 tập tin nhưng tôi muốn tất cả mp3, mp4, mkv, avi, mở rộng các tập tin ... làm thế nào tôi có thể nhận được tất cả các tập tin – NextStep

+0

đọc câu hỏi này http://stackoverflow.com/questions/13736532/google-drive-api-list-multiple -mime-loại – Rushabh

+0

ya tôi nghĩ u đúng .. hãy để tôi kiểm tra xem nó ... – NextStep

Các vấn đề liên quan