Question

In my app I have to upload files to server.

For that I need to view and choose files from my iPhone and iPad. (any kind of files i.e pdf , doc,dock , mp3 etc etc).

How can I get the path for these files and how can I choose them in my application.

Generally in iPhone Where are these files are stored? how we can fetch them in our application?

Is there any thing like UIImagePickerController to pick file from iPhone?

No correct solution

OTHER TIPS

There are classes that allow you to interact with various media types that may be on an iOS based device.

As you mention UIImagePickerController.

For music, you can use a similar class: MPMediaPickerControllerDelegate.

With regard to other arbitrary documents;

There is no device-wide document store, and you cannot access files stored inside another app's app bundle, thus you cannot access saved PDF/doc files. There is no shared place for the user to save such PDFs in the first place. Which is why media libraries have specific APIs to access them because they are device-wide libraries.

The most you can do is register your app as a viewer of PDF documents. This would allow other apps to open a PDF in your app if they use a UIDocumentInteractionController.

Your best option is probably to use File Sharing which will allow your application to own files on the device which can be synced via iTunes.

This will enable you to create your own UI, to present these files from your applications document folder.

Further reading: iOS File System Basics, File System Programming Guide.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top