Cocoa Touch: Writing files to user's cloud storage

In my app the user can go to a cloud provider, such as Dropbox, click on an appropriate CSV or TXT file and open it in my App. My App converts the incoming data to a specific doc format (it contains the data in the CSV file plus data how various parameters the user input to process the data). The App removes the path extension and provides a new path extension. I would like to write this file back to the user's folder in the cloud provider (eg Dropbox). Is this possible just using file manager calls, or do I have to use the Dropbox API. The issue is that I don't want to have to write various versions for other cloud providers such as OneDrive and Box.

My other option is the save the file with the modified format for my App in the App Document directory. However, when the user goes back to the Document Browser, it is still shows the Dropbox area. Is there a way to tell the Document Browser which location you want it to return to (eg the sandboxed Document directory.

Is this possible just using file manager calls … ?

No. When the user selects a file the system punches a hole in your app’s sandbox to allow you to access just that file. You cannot access other files in the same directory, and that includes related files such as files that differ only by their extension.

One option is to present a new UI to let the user choose the location where they want you to save the converted file. The main drawback with that approach is that it gets tedious if you want to convert many files. If that’s a likely scenario in your app you can implement a batch convert function, where the user chooses a directory and you convert everything in that directory.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Cocoa Touch: Writing files to user's cloud storage
 
 
Q