I'm trying filter only for typical docs extensions:
type: [
'.pdf',
'.docx',
'com.microsoft.word.docx',
'application/docx',
'com.microsoft.excel.xlsx',
'application/xlsx',
'.xlsx'
],
but I can't select them

I try too
type: [
".docx application/docx com.microsoft.word.docx",
".doc application/doc com.microsoft.word.doc",
".xlsx application/xlsx com.microsoft.excel.xlsx",
".xls application/xls com.microsoft.excel.xls",
DocumentPicker.types.pdf,
],
same issue. @franjorub Did you find any solution ?
@imbudhiraja yes I use react-native-mime-types and Every lookup funci贸n as array position
same issue. @franjorub Did you find any solution ? Example, please !!!
@franjorub can you please share a working example.
@franjorub I'm using this right now. but its not working. I'm using v3.2.4
const types = [
DocumentPicker.types.pdf,
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/vnd.ms-powerpoint',
'application/vnd.openxmlformats-officedocument.presentationml.presentation',
'application/vnd.oasis.opendocument.text',
];
@douglas-cavalcante working code for .docx, .pptx, .xlsx, .pdfs.
const iosTypes = [
'org.openxmlformats.wordprocessingml.document',
'com.adobe.pdf',
'org.openxmlformats.spreadsheetml.sheet',
'org.openxmlformats.presentationml.presentation',
];
const androidTypes = [
'application/msword',
'application/pdf',
'application/vnd.ms-excel',
'application/vnd.ms-powerpoint',
];
Hope this works for you as well.
Hi guys, sorry the late, this is how I was solved the issue
type: [
mime.lookup('docx'),
mime.lookup('xlsx'),
mime.lookup('doc'),
mime.lookup('xls'),
],2. type: [ mime.lookup('docx'), mime.lookup('xlsx'), mime.lookup('doc'), mime.lookup('xls'), ],
this will not work on iOS. Correct iOS type will be (as mentioned by @imbudhiraja )
const iosTypes = [
'org.openxmlformats.wordprocessingml.document',
'com.adobe.pdf',
'org.openxmlformats.spreadsheetml.sheet',
'org.openxmlformats.presentationml.presentation',
];
https://github.com/Elyx0/react-native-document-picker/issues/240#issuecomment-536447325 seems to be the correct way to do this, closing as answered.
Most helpful comment
Hi guys, sorry the late, this is how I was solved the issue
type: [ mime.lookup('docx'), mime.lookup('xlsx'), mime.lookup('doc'), mime.lookup('xls'), ],And works perfect