Search code examples
iosswift3nsurl

Access private folder in iOS


I have some files in which they after being downloaded they are stored in the following folder/path

/private/var/mobile/Containers/Data/Application/5527BBC6-651F-4E29-A3ED-E31FABCE958F/Documents/7A7D61AE-B368-4999-8A59-C88AD5AA07CD.pdf

inside the /private/ folder.

How can I access this file? no matter what I cannot access them, am I missing some permission in the app?

How can I create an URL to access files at that /private/ path?

Thanks for helping


Solution

  • An app cannot access files not on its own container - app is in a sandbox.

    Check out this documentation for More information

    Specifically:

    An app is generally prohibited from accessing or creating files outside its container directories. One exception to this rule is when an app uses public system interfaces to access things such as the user’s contacts or music.