Expo Docs


Provides access to the system's UI for selecting documents from the available providers on the user's device.
On iOS, for standalone apps and ExpoKit projects, the DocumentPicker module requires the iCloud entitlement to work properly. You need to set the usesIcloudStorage key to true in your app.json file as specified here.
In addition, for ExpoKit apps, you need to open the project in Xcode and follow the Using DocumentPicker instructions in the Advanced ExpoKit Topics guide.

Display the system UI for choosing a document. By default, the chosen file is copied to the app's internal cache directory.

  • options (object) --
    A map of options:
    • type (string) -- The MIME type of the documents that are available to be picked. Is also supports wildcards like image/* to choose any image. To allow any type of document you can use */*. Defaults to */*.
    • copyToCacheDirectory (boolean) -- If true, the picked file is copied to Expo.FileSystem.CacheDirectory, which allows other Expo APIs to read the file immediately. Defaults to true. This may impact performance for large files, so you should consider setting this to false if you expect users to pick particularly large files and your app does not need immediate read access.

If the user cancelled the document picking, returns { type: 'cancel' }.
Otherwise, returns { type: 'success', uri, name, size } where uri is a URI to the local document file, name is its original name and size is its size in bytes.