Skip to content

Commit

Permalink
Merge pull request #304 from apiel51/master
Browse files Browse the repository at this point in the history
Add support for csv files
  • Loading branch information
vonovak authored May 7, 2020
2 parents cbd209f + ef9ef67 commit 26c51b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ The base64 encoded content of the picked file if the option `readContent` was se
- `DocumentPicker.types.audio`: All audio types (`audio/*` or `public.audio`)
- `DocumentPicker.types.pdf`: PDF documents (`application/pdf` or `com.adobe.pdf`)
- `DocumentPicker.types.zip`: Zip files (`application/zip` or `public.zip-archive`)
- `DocumentPicker.types.csv`: Csv files (`text/csv` or `public.comma-separated-values-text`)
### `DocumentPicker.isCancel(err)`
Expand Down
3 changes: 3 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ declare module 'react-native-document-picker' {
mimeTypes: {
allFiles: '*/*',
audio: 'audio/*',
csv: 'text/csv',
images: 'image/*',
plainText: 'text/plain',
pdf: 'application/pdf',
Expand All @@ -22,6 +23,7 @@ declare module 'react-native-document-picker' {
utis: {
allFiles: 'public.content',
audio: 'public.audio',
csv: 'public.comma-separated-values-text',
images: 'public.image',
plainText: 'public.plain-text',
pdf: 'com.adobe.pdf',
Expand All @@ -32,6 +34,7 @@ declare module 'react-native-document-picker' {
allFiles: '*',
audio:
'.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma',
csv: '.csv',
images: '.jpeg .jpg .png',
plainText: '.txt',
pdf: '.pdf',
Expand Down
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const Types = {
mimeTypes: {
allFiles: '*/*',
audio: 'audio/*',
csv: 'text/csv',
images: 'image/*',
plainText: 'text/plain',
pdf: 'application/pdf',
Expand All @@ -86,6 +87,7 @@ const Types = {
utis: {
allFiles: 'public.content',
audio: 'public.audio',
csv: 'public.comma-separated-values-text',
images: 'public.image',
plainText: 'public.plain-text',
pdf: 'com.adobe.pdf',
Expand All @@ -96,6 +98,7 @@ const Types = {
allFiles: '*',
audio:
'.3g2 .3gp .aac .adt .adts .aif .aifc .aiff .asf .au .m3u .m4a .m4b .mid .midi .mp2 .mp3 .mp4 .rmi .snd .wav .wax .wma',
csv: '.csv',
images: '.jpeg .jpg .png',
plainText: '.txt',
pdf: '.pdf',
Expand Down

0 comments on commit 26c51b4

Please sign in to comment.