Reputation: 1117
How can I sync very big files like Video files to Google drive using GTLServiceDrive service? I know that sync is possible using queryForFilesInsertWithObject:uploadParameters: method. But here I pass data as a parameter of GTLUploadParameters object. But if I am uploading big files, I cannot hold the whole object in memory. Does Google drive ios sdk supports multi-part upload? If Yes, can someone point me how to do it.
Thanks in advance!
Upvotes: 0
Views: 192
Reputation: 3151
Instead of reading the file contents into a NSData
instance you can configure your upload parameters to use a NSFileHandle
to the file you want to upload. The SDK will upload the file in chunks.
NSString *filePath = @"/path/to/file";
NSString *mimeType = @"text/plain";
NSFileHandle *file = [NSFileHandle fileHandleForReadingAtPath:filePath];
GTLUploadParameter *uploadParameters = [GTLUploadParameters uploadParametersWithFileHandle:file
MIMEType:mimeType];
Official documentation here.
Upvotes: 1