HSGoogleDrivePicker icon indicating copy to clipboard operation
HSGoogleDrivePicker copied to clipboard

File not downloading

Open maheshcheliya opened this issue 7 years ago • 2 comments

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
                }
            }];
}];

maheshcheliya avatar Apr 13 '17 06:04 maheshcheliya

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
                            }
                        }];
                    }];

ConfusedVorlon avatar Aug 14 '17 15:08 ConfusedVorlon

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.

ConfusedVorlon avatar Aug 15 '17 10:08 ConfusedVorlon