-4

I need to select the file which is downloaded through mail. That text document need to be loaded into my app.

Is there any chance to do?

2 Answers2

1

Apps on iOS are sandboxed, so they can not access any files outside of there own sandbox. There is no user accessible file system thus you can not select a file that is downloaded through mail.

There is the option to allow your app to open files, by extension. You register your to, for example open txt files. Then when you have a txt file in your mail you wil be prompt that you can open the file in your app.

You can find all you need in this Apple document: Registering the File Types Your App Supports

rckoenes
  • 69,092
  • 8
  • 134
  • 166
  • -1. By he can make his app visible in "Open With..." menu. And this file will be copied into app's folder. So actually he can select a file that is downloaded through mail. – Cy-4AH Jan 29 '15 at 09:33
  • That is true but the question is about a file explorer, not about just how to open a file in your own app, so you -1 is not really correct since my answer is correct. But I've added a link to official Apple document explaining file association. – rckoenes Jan 29 '15 at 09:44
0

Only if declare that your application can handle that document type then the user will get the chance to open the file with your app When they select from the mail app. This will call delegate method from you app where you can do with the file as you wish.

First you need to declare to the iOS system that your application can handle that file type.

you do this by adding by adding key:values to your applications-info.plist

This guide is what you need to follow

http://mobiforge.com/design-development/importing-exporting-documents-ios

scroll down to the part

Importing Documents

RyanTCB
  • 7,400
  • 5
  • 42
  • 62