HSGoogleDrivePicker
HSGoogleDrivePicker copied to clipboard
File not downloading
I used below code for download file, file downloading work well when file name have extension (like abc.png, xyz.docx, aaa.pdf). if any file has no extension in name (like abc, xyz, aaa), that file is not downloading, it gives error : The operation couldn’t be completed. (com.google.HTTPStatus error 403.)
HSDrivePicker *picker = [[HSDrivePicker alloc] initWithSecret:googleDriveClientSecret];
[picker pickFromViewController:self withCompletion:^(HSDriveManager *manager, GTLDriveFile *file) {
[manager downloadFile:file toPath:tmpstrmahesh withCompletionHandler:^(NSError *error) {
if (error)
{
NSLog(@"Error downloading : %@", error.localizedDescription);
}
else
{
//success code
}
}];
}];
It's working for me!
tested in iOS 8 and iOS 10 using version 2.1 of the picker
[picker pickFromViewController:self
withCompletion:^(HSDriveManager *manager, GTLDriveFile *file) {
self.pickedFile.text = [NSString stringWithFormat: @"selected: %@",file.name];
NSString *filePath = [NSTemporaryDirectory() stringByAppendingPathComponent:file.name];
NSLog(@"Download to : %@", filePath);
[manager downloadFile:file toPath:filePath withCompletionHandler:^(NSError *error) {
if (error)
{
NSLog(@"Error downloading : %@", error.localizedDescription);
}
else
{
//success code
}
}];
}];
I'm re-opening this. I'm seeing this when I try to download google docs as opposed to standard files.
I'm seeing a 403 error on these. I don't know why - any suggestions or fixes welcome.