You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,10 @@ The type or types of documents to allow selection of. May be an array of types a
47
47
- If `type` is omitted it will be treated as `*/*` or `public.item`.
48
48
- Multiple type strings are not supported on Android before KitKat (API level 19), Jellybean will fall back to `*/*` if you provide an array with more than one value.
49
49
50
+
##### [iOS only]`mode`:`"import" | "open"`:
51
+
52
+
Defaults to `import`. If `mode` is set to `import` the document picker imports the file from outside to inside the sandbox, otherwise if `mode` is set to `open` the document picker opens the file right in place.
If specified, the picked file is copied to `NSCachesDirectory` / `NSDocumentDirectory` directory. The uri of the copy will be available in result's `fileCopyUri`. If copying the file fails (eg. due to lack of space), `fileCopyUri` will be the same as `uri`, and more details about the error will be available in `copyError` field in the result.
@@ -76,7 +80,7 @@ The object a `pick` Promise resolves to or the objects in the array a `pickMulti
76
80
77
81
##### `uri`:
78
82
79
-
The URI representing the document picked by the user. _On iOS this will be a `file://` URI for a temporary file in your app's container. On Android this will be a `content://` URI for a document provided by a DocumentProvider that must be accessed with a ContentResolver._
83
+
The URI representing the document picked by the user. _On iOS this will be a `file://` URI for a temporary file in your app's container if `mode` is not specified or set at `import` otherwise it will be the original `file://` URI. On Android this will be a `content://` URI for a document provided by a DocumentProvider that must be accessed with a ContentResolver._
80
84
81
85
##### `fileCopyUri`:
82
86
@@ -116,10 +120,15 @@ The base64 encoded content of the picked file if the option `readContent` was se
116
120
-`DocumentPicker.types.xls`: xls files
117
121
-`DocumentPicker.types.xlsx`: xlsx files
118
122
119
-
### `DocumentPicker.isCancel(err)`
123
+
####`DocumentPicker.isCancel(err)`
120
124
121
125
If the user cancels the document picker without choosing a file (by pressing the system back button on Android or the Cancel button on iOS) the Promise will be rejected with a cancellation error. You can check for this error using `DocumentPicker.isCancel(err)` allowing you to ignore it and cleanup any parts of your interface that may not be needed anymore.
0 commit comments