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
@@ -51,11 +90,11 @@ Open a system directory picker. Returns a promise that resolves to (`{ uri: stri
51
90
52
91
All of the options are optional
53
92
54
-
##### `allowMultiSelection`:`boolean`:
93
+
##### `allowMultiSelection`:`boolean`
55
94
56
95
Whether or not selecting multiple files is allowed. For `pick`, this is `false` by default. `allowMultiSelection` is `false` for `pickSingle` and `true` for `pickMultiple` and cannot be overridden for those calls.
57
96
58
-
##### `type`:`string|Array<string>`:
97
+
##### `type`:`string|Array<string>`
59
98
60
99
The type or types of documents to allow selection of. May be an array of types as single type string.
61
100
@@ -67,11 +106,11 @@ The type or types of documents to allow selection of. May be an array of types a
67
106
68
107
Controls how the picker is presented, eg. on an iPad you may want to present it fullscreen. Defaults to `pageSheet`.
69
108
70
-
##### [iOS only]`mode`:`"import" | "open"`:
109
+
##### [iOS only]`mode`:`"import" | "open"`
71
110
72
111
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.
73
112
74
-
##### [iOS and Android only]`copyTo`:`"cachesDirectory" | "documentDirectory"`:
113
+
##### [iOS and Android only]`copyTo`:`"cachesDirectory" | "documentDirectory"`
75
114
76
115
If specified, the picked file is copied to `NSCachesDirectory` / `NSDocumentDirectory` (iOS) or `getCacheDir` / `getFilesDir` (Android). 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.
77
116
@@ -98,27 +137,27 @@ Defaults to `false`. If `readContent` is set to true the content of the picked f
98
137
99
138
The `pick` Promise resolves to an array of objects with the following keys.
100
139
101
-
##### `uri`:
140
+
##### `uri`
102
141
103
142
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._
104
143
105
-
##### `fileCopyUri`:
144
+
##### `fileCopyUri`
106
145
107
146
Same as `uri`, but has special meaning if `copyTo` option is specified.
108
147
109
-
##### `type`:
148
+
##### `type`
110
149
111
150
The MIME type of the file. _On Android some DocumentProviders may not provide MIME types for their documents. On iOS this MIME type is based on the best MIME type for the file extension according to Apple's internal "Uniform Type Identifiers" database._
112
151
113
-
##### `name`:
152
+
##### `name`
114
153
115
154
The display name of the file. _This is normally the filename of the file, but Android does not guarantee that this will be a filename from all DocumentProviders._
116
155
117
-
##### `size`:
156
+
##### `size`
118
157
119
158
The file size of the document. _On Android some DocumentProviders may not provide this information for a document._
120
159
121
-
##### [Windows only]`content`:
160
+
##### [Windows only]`content`
122
161
123
162
The base64 encoded content of the picked file if the option `readContent` was set to `true`.
124
163
@@ -203,18 +242,13 @@ try {
203
242
}
204
243
```
205
244
206
-
## Here is how it looks:
207
-
208
-
<imgsrc="./docs/screenshot.jpeg"height="400">
209
-
210
245
## How to upload picked files?
211
246
212
247
Use blob support that is built into react native - [see comment](https://github.com/rnmods/react-native-document-picker/issues/70#issuecomment-384335402).
213
248
If you need to track upload progress, use `XMLHttpRequest`[see here](https://gist.github.com/Tamal/9231005f0c62e1a3f23f60dc2f46ae35)
214
249
215
250
Alternatively, use [https://github.com/johanneslumpe/react-native-fs](https://github.com/johanneslumpe/react-native-fs)
0 commit comments