I am using file browser plugin, which is really good BTW. plugin description says that if I pass a path to get files from, I can get all the files inside that path, I wanted to know what path should I send to get all the files and folders including all the images and documents as well.
Asked
Active
Viewed 45 times
1 Answers
0
NSFileManager.defaultManager().URLsForDirectory(.DocumentDirectory, inDomains: .UserDomainMask)
The above code will return an array which will have only one URL for the Documents directory of the app. Presuming you have stored all the images and other contents in this location you can pass this url path to the file browser library.
This method returns an array of path in URL of the directory you want to search for.
Reference to this method: https://developer.apple.com/reference/foundation/nsfilemanager/1407726-urlsfordirectory

nishantdesai
- 116
- 1
- 3
-
I have tried it it only gives me, files in my app's own documents directory, i want to know how to get files from other apps documents directory – Prashanth Kumar B Jul 28 '16 at 08:59
-
You cannot do that. The reason being that the apps in iOS are sandboxed so no apps can access each other's Documents directory. Unless the device is jailbroken. [Apple File System Basics](https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html) This should help you get a better understanding. – nishantdesai Jul 28 '16 at 09:04
-
So how, do i give an option to upload images or other documents which are there in that particular iPhone – Prashanth Kumar B Jul 29 '16 at 05:08