Allowed formats

Define your own list of permitted formats

The allowed formats are based on MIME types, which define the nature and format of a file. You can refer to the official IANA Media Types list or https://mimetype.io/all-types (recommended) to check the available MIME types.

Accept only PNG, JPG and BMP files
<DropUpload allowedFormats={[
    "image/png",
    "image/jpeg",
    "image/bmp",
]} />

Wildcards

If you want to allow all image formats, you can use image/*. The same applies to video, application, audio, font, etc.

Users will then be prompted to select "any image file" instead of "JPG or PNG files".

<DropUpload allowedFormats={["image/*"]} />


Multiple formats

Different file formats and wildcards can be combined in the allow list.

<DropUpload allowedFormats={[
    "image/png", // .png
    "image/jpeg",
    "image/bmp",
    "video/*", // Any video
    "audio/*", // Any audio
    "font/ttf",
    "font/otf"
]} />


Formats Label Customization

Label: Custom text

When you specify a list of allowed formats, an automatic text is generated that will appear in the userโ€™s UI, indicating which image formats they can upload. For example, โ€œJPG, PNG, or GIF.โ€ However, you can choose to provide your own text, such as โ€œCute cat pics only.โ€


Label Mode

The generated text is created based on the allowed MIME types. By default, the most popular format for each MIME type is selected and displayed. However, some MIME types encompass more than one file extension. You can choose to display just one, the entire group of file extensions, a custom text, or nothing at all.

Mode
Description
Example (image/jpeg)

auto (default)

Suggest the most important extension for the MIME type in text (the other extensions of the MIME will be valid as well)

JPG

auto-full

Suggest the entire list of extensions for the MIME Type

.jpe, .jpeg, .jpg, .pjpg, .jfif, .jfif-tbnl, .jif

custom

Personalized text

Cute cat pics only!

off

Hide the text

Last updated