|
@@ -40,7 +40,7 @@ Something that a few of our biggest fans were asking for, is finally here! Here'
|
|
|
|
|
|
Basically, there are two ways to set restrictions:
|
|
Basically, there are two ways to set restrictions:
|
|
|
|
|
|
-1. Using the `restrictions` object in Uppy's core settings:
|
|
|
|
|
|
+1\. Using the `restrictions` object in Uppy's core settings:
|
|
|
|
|
|
```js
|
|
```js
|
|
restrictions: {
|
|
restrictions: {
|
|
@@ -51,11 +51,11 @@ restrictions: {
|
|
}
|
|
}
|
|
```
|
|
```
|
|
|
|
|
|
-Translation: allow only images and videos of any type, a minimum of 2 and maximum of 5 files must be selected, amounting to a total of less than 300 KB.
|
|
|
|
|
|
+Translation: allow only images and videos of any type, a minimum of 2 and maximum of 5 files must be selected, 300kb or less.
|
|
|
|
|
|
`allowedFileTypes` must be an array of strings with supported file mime-types. Anything from [this list](https://www.iana.org/assignments/media-types/media-types.xhtml) should work, as long as Uppy is able to detect it (and Uppy promises to try real hard, see below for details). Both wildcards `video/*` and specicifc types `image/jpeg` are supported!
|
|
`allowedFileTypes` must be an array of strings with supported file mime-types. Anything from [this list](https://www.iana.org/assignments/media-types/media-types.xhtml) should work, as long as Uppy is able to detect it (and Uppy promises to try real hard, see below for details). Both wildcards `video/*` and specicifc types `image/jpeg` are supported!
|
|
|
|
|
|
-2. Using the more advanced callbacks: `onBeforeFileAdded(currentFile, files)`, which fires before a file is added and allows you to run whatever checks you wish against either the single file that is about to be added or all files currently selected / uploaded, and `onBeforeUpload(files)`, where you are able to check stuff before proceeding with the upload.
|
|
|
|
|
|
+2\. Using the more advanced callbacks: `onBeforeFileAdded(currentFile, files)`, which fires before a file is added and allows you to run whatever checks you wish against either the single file that is about to be added or all files currently selected / uploaded, and `onBeforeUpload(files)`, where you are able to check stuff before proceeding with the upload.
|
|
|
|
|
|
Basically, use the first option for the simple stuff such as limiting uploads to images or a maximum of three files. Use the second option for things like “we need users to upload 5 photos and an audio file, so we can make a short clip out of it”. Let us know if this suits your needs, we are all 👂ears👂!
|
|
Basically, use the first option for the simple stuff such as limiting uploads to images or a maximum of three files. Use the second option for things like “we need users to upload 5 photos and an audio file, so we can make a short clip out of it”. Let us know if this suits your needs, we are all 👂ears👂!
|
|
|
|
|