How to access files in files app in "On My iPhone"

Hi there,

I am trying to write an app that accesses zip files that are stored in the "On My iPhone" folder in the files app. Specifically, I am trying to access a folder named Slopes that has these zip files. Once I have these, I am trying to look at a xml file from the extraction. I've tried the Document-Based app but had no luck as well as FileManager but I'm not sure how to get to the folder. Ideally, it would be great to access these files without the users input to select the folder where the files are.

Any help would be extremely appreciated. Thank you in advance!

- Matthew

Accepted Answer

On My iPhone isn’t a real location on the disk. Rather, it’s a synthetic representation of all the apps that have a Documents directory that’s published by setting the UIFileSharingEnabled flag. Unless the user happens to have stored this zip archive within your own app’s Documents directory, this content is outside of your app’s sandbox and thus you’ll have to access it like any other such content, using a file choosing UI like UIDocumentPickerViewController.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

How to access files in files app in "On My iPhone"
 
 
Q