Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Quentin M.3
10 years agoNew member | Level 1
Never ending uploads with DropBox document picker export mode
Hi,
I wrote an app where people can backup the app data with iOS document menu/picker, it seems to work flawlessly with iCloud. I'm using iOS 9.2.1 and DropBox 4.2.
When I choose to export with D...
Quentin M.3
10 years agoNew member | Level 1
Thanks Gregory for your help!
The backup is a document bundle with a custom extension '.pwbackup', so may be there is something wrong with exporting a directory like that to Dropbox, and it would be better to create a zip archive.
To do the export, inside my app document directory I prepare a backup bundle, that contains a SQLite database, some attachments and a property list, then I present a UIDocumentMenuViewController:
let menu = UIDocumentMenuViewController(URL: backupURL, inMode: .ExportToService)
presentViewController(menu, animated: true, completion: nil)
When the user chooses the picker in the menu, I present it with:
func documentMenu(documentMenu: UIDocumentMenuViewController, didPickDocumentPicker documentPicker: UIDocumentPickerViewController) {
documentPicker.delegate = self
presentViewController(documentPicker, animated: true) { }
}
When the document picker is done, I get rid of the backup I prepared locally. With Dropbox, this part is never called, since the transfer doesn't succeed:
func documentPicker(controller: UIDocumentPickerViewController, didPickDocumentAtURL url: NSURL) {
try NSFileManager().removeItemAtURL(backupURL)
}
In my app Info.plist, I have the following exported UTIs:
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.composite-content</string>
<string>public.database</string>
<string>com.apple.package</string>
</array>
<key>UTTypeDescription</key>
<string>Placeboard Backup</string>
<key>UTTypeIdentifier</key>
<string>com.placeboardapp.backup</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>pwbackup</string>
</array>
</dict>
</dict>
</array>
Let me know if you need some additional info or code.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!