Skip to content

Commit

Permalink
Merge pull request #2870 from asashour/onlyAllowedExtensions
Browse files Browse the repository at this point in the history
fix: specify accept extensions in file upload
  • Loading branch information
allardy committed Jan 20, 2020
2 parents d34083b + d5b3ec7 commit 2f05161
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions modules/qna/src/views/full/ImportModal.tsx
Expand Up @@ -143,6 +143,7 @@ Either the file is empty, or it doesn't match any known format.`)
<FileInput
text={filePath || 'Choose file...'}
onChange={e => readFile((e.target as HTMLInputElement).files)}
inputProps={{ accept: '.json' }}
fill={true}
/>
</FormGroup>
Expand Down
Expand Up @@ -114,6 +114,7 @@ const UploadArchive = () => {
<FileInput
text={filePath || 'Choose file...'}
onChange={e => readArchive((e.target as HTMLInputElement).files)}
inputProps={{ accept: '.tgz' }}
fill={true}
/>
</FormGroup>
Expand Down
8 changes: 2 additions & 6 deletions src/bp/ui-admin/src/Pages/Workspace/Bots/ImportBotModal.tsx
Expand Up @@ -139,16 +139,12 @@ class ImportBotModal extends Component<Props, State> {
autoFocus={true}
/>
</FormGroup>
<FormGroup
label="Bot Archive"
labelInfo="*"
labelFor="archive"
helperText="File must be a valid .zip or .tgz archive"
>
<FormGroup label="Bot Archive" labelInfo="*" labelFor="archive">
<FileInput
tabIndex={2}
text={this.state.filePath || 'Choose file...'}
onChange={event => this.handleFileChanged((event.target as HTMLInputElement).files)}
inputProps={{ accept: '.zip,.tgz' }}
/>
</FormGroup>
</div>
Expand Down

0 comments on commit 2f05161

Please sign in to comment.