# File Restrictions

You can restrict the selected files based on predefined rules for their size and/or extension.

> When the FileSelect is bound to a model through the `ngModel` directive, the files which do not correspond to the restrictions will not be added to the model.

## Types of File Restrictions

The FileSelect supports three types of file restrictions:

<Row>
  <Column count={[24,24,8]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#file-extension">
      <ComponentTitle>File Extension</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Restrict files by allowed extensions using the allowedExtensions property to control file types.</ComponentDescription>
    </Component>
  </Column>
  <Column count={[24,24,8]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#maximum-file-size">
      <ComponentTitle>Maximum File Size</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Limit the maximum file size in bytes using maxFileSize to prevent oversized uploads.</ComponentDescription>
    </Component>
  </Column>
  <Column count={[24,24,8]} style={{marginBottom: "1rem"}}>
    <Component className="tile" href="#minimum-file-size">
      <ComponentTitle>Minimum File Size</ComponentTitle>
      <ComponentDescription style={{padding: "0 10px 10px 10px"}}>Set the minimum file size in bytes using minFileSize to ensure files meet size requirements.</ComponentDescription>
    </Component>
  </Column>
</Row>

### File Extension

You can define the file types that are eligible by using the [allowedExtensions](https://www.telerik.com/kendo-angular-ui/components/uploads/api/filerestrictions#allowedextensions) property. The files with extensions, which are not included in the list will be displayed as invalid by the FileSelect. The `allowedExtensions` option recognizes entries of both `.type` (for example, `.docx`, `.png`, `.svg`, `.xls`, and others) and `type` (for example, `docx`, `png`, `svg`, `xls`, and others) values.

The following example allows selecting `.jpg` and `.png` file types only.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/uploads/fileselect/restrictions/extensions/source.txt)

### Maximum File Size

You can restrict the maximum allowed file size (in bytes) by using the [maxFileSize](https://www.telerik.com/kendo-angular-ui/components/uploads/api/filerestrictions#maxfilesize) property. If the selected file exceeds the maximum size, an error message will be displayed.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/uploads/fileselect/restrictions/maxfilesize/source.txt)

### Minimum File Size

You can restrict the minimum allowed file size (in bytes) by using the [minFileSize](https://www.telerik.com/kendo-angular-ui/components/uploads/api/filerestrictions#minfilesize) property. If the selected file is less than the minimum size, an error message will be displayed.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/uploads/fileselect/restrictions/minfilesize/source.txt)

## Browser Limitations

Internet Explorer versions up to and including version 9 provide no information on the file size. As a result, the FileSelect restriction for the `minFileSize` and `maxFileSize` options does not work.

## Suggested Links

* [API Reference of the FileSelect](https://www.telerik.com/kendo-angular-ui/components/uploads/api/fileselectcomponent)
