6

I'm using iOS8 UIDocumentPickerViewController to export and import a zip file to different cloud services (iCloud,DropBox,Drive, etc.).

I don't have issues with iCloud and Dropbox, but with Google Drive I can't import the file because it is grayed out in the interface that displays files (export is working like a charm).

The funny thing is that if I upload a zip file to Drive via the Web interface, the file is not grayed out and I can import it via UIDocumentPickerViewController - so I suspect this is an issue during the export that create the issue when I want to import the zip file.

Notes:

The exported zip file can of course be downloaded via Google drive web interface.

I tried to use a proprietary extensions (instead of .zip) defined it the info.plist, but it is the same result (works everywhere except when importing from Drive)

I thought the issue was with the UTI passed to UIDocumentPickerViewController but I tried all kind of UTI (kUTTypeZipArchive, @"public.archive", @"public.zip-archive") with no success (in both case: with a proprietary extension, or with a .zip extension)

I also export/import XML files (with a proprietary extension) and everything is working well for all cloud services including Drive - I just had to add the "public.data" UTI in the allowed UTIs in UIDocumentPickerViewController.

Pierre
  • 417
  • 3
  • 11

1 Answers1

3

This seems to be a bug in Google Drive. It does not handle the allowedUTIs correctly.

I also wanted to open my own proprietary types, but they didn't work. I had to add "public.data" to allow all files and check the extension when a document was picked. This is not as nice as if only my types were available in the picker, but it works.

Michael Rumpler
  • 305
  • 2
  • 17