Im using react-google-picker for my react app to open google drive and i want to open only specific doc types(doc, docx, txt) in file picker.
Documentation (https://www.npmjs.com/package/react-google-picker) provide file types for images but not for others.
mimeTypes={['image/png', 'image/jpeg', 'image/jpg']}
I found the file type for text is as
mimeTypes={['text/doc']}
Could anyone please help me to find exact file types for doc and docx
Following is the way i load picker component
<GooglePicker clientId={'xxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com'}
developerKey={'xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'}
scope={['https://www.googleapis.com/auth/drive.readonly']}
onChange={data => this.uploadDriveFile(data)}
onAuthenticate={token => this.setGoogleDriveToken(token)}
onAuthFailed={data => console.log('on auth failed:', data)}
multiselect={false}
navHidden={false}
authImmediate={false}
mimeTypes={["text/doc"]}
query={''}
viewId={'DOCS'}>
<button> open google drive </button>
</GooglePicker>
Aucun commentaire:
Enregistrer un commentaire