Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ If you are using RN >= 0.63, only run `pod install` from the ios directory. Then

Use `pickMultiple`, `pickSingle` or `pick` to open a document picker for the user to select file(s). All methods return a Promise.

#### [Android only] `DocumentPicker.pickDirectory()`
#### [Android and Windows only] `DocumentPicker.pickDirectory()`

Open a system directory picker. Returns a promise that resolves to (`{ uri: string }`) of the directory selected by user.

Expand Down Expand Up @@ -77,7 +77,7 @@ If specified, the picked file is copied to `NSCachesDirectory` / `NSDocumentDire

This should help if you need to work with the file(s) later on, because by default, [the picked documents are temporary files. They remain available only until your application terminates](https://developer.apple.com/documentation/uikit/uidocumentpickerdelegate/2902364-documentpicker). This may impact performance for large files, so keep this in mind if you expect users to pick particularly large files and your app does not need immediate read access.

##### [UWP only] `readContent`:`boolean`
##### [Windows only] `readContent`:`boolean`

Defaults to `false`. If `readContent` is set to true the content of the picked file/files will be read and supplied in the result object.

Expand Down Expand Up @@ -118,7 +118,7 @@ The display name of the file. _This is normally the filename of the file, but An

The file size of the document. _On Android some DocumentProviders may not provide this information for a document._

##### [UWP only] `content`:
##### [Windows only] `content`:

The base64 encoded content of the picked file if the option `readContent` was set to `true`.

Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ type DocumentPickerOptions<OS extends SupportedPlatforms> = {
}

export function pickDirectory(): Promise<DirectoryPickerResponse | null> {
if (Platform.OS === 'android') {
if (Platform.OS === 'android' || Platform.OS === 'windows') {
return RNDocumentPicker.pickDirectory()
} else {
// TODO windows impl
// TODO iOS impl
return Promise.resolve(null)
}
}
Expand Down
Loading