mirror of
https://github.com/transloadit/uppy.git
synced 2026-07-25 03:08:34 +00:00
talk about maxNumberOfFiles and allowedFileTypes affecting system file dialog
This commit is contained in:
parent
4e8771c283
commit
f82cbbfd7a
1 changed files with 13 additions and 8 deletions
|
|
@ -15,10 +15,10 @@ const uppy = Uppy({
|
|||
autoProceed: true,
|
||||
debug: false,
|
||||
restrictions: {
|
||||
maxFileSize: false,
|
||||
maxNumberOfFiles: false,
|
||||
minNumberOfFiles: false,
|
||||
allowedFileTypes: false
|
||||
maxFileSize: null,
|
||||
maxNumberOfFiles: null,
|
||||
minNumberOfFiles: null,
|
||||
allowedFileTypes: null
|
||||
},
|
||||
meta: {},
|
||||
onBeforeFileAdded: (currentFile, files) => currentFile,
|
||||
|
|
@ -52,10 +52,15 @@ Optionally provide rules and conditions for which files can be selected.
|
|||
|
||||
**Parameters**
|
||||
|
||||
- `maxFileSize` *number*
|
||||
- `maxNumberOfFiles` *number*
|
||||
- `minNumberOfFiles` *number*
|
||||
- `allowedFileTypes` *array* of wildcards or exact mime types, like `image/*`
|
||||
- `maxFileSize` *null | number*
|
||||
- `maxNumberOfFiles` *null | number*
|
||||
- `minNumberOfFiles` *null | number*
|
||||
- `allowedFileTypes` *null | array* of wildcards `image/*`, exact mime types `image/jpeg`, or file extensions `.jpg`: `['image/*', '.jpg', '.jpeg', '.png', '.gif']`
|
||||
|
||||
`maxNumberOfFiles` affects the number of files user is able to select via the system file dialog in UI plugins like `DragDrop`, `FileInput` and `Dashboard`: when set to `1` they will only be able to select a single file, otherwise, when `null` or other number, they will be able to select multiple files.
|
||||
|
||||
`allowedFileTypes` array also gets passed to the system file dialog (see [`input[type=file]` accept](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Limiting_accepted_file_types)), so user will only be able to select images, for example.
|
||||
|
||||
|
||||
### `meta: {}`
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue