> For the complete documentation index, see [llms.txt](https://docs.hivepress.io/developer-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hivepress.io/developer-docs/framework/fields/file.md).

# File

This field type renders a file picker.

### Parameters

* **formats** - an array of the allowed file extensions;
* **multiple** - set to `true` to allow selecting multiple files.

### Example

The code below renders a required file picker with the `custom_field` name and "Custom field" label. It allows selecting multiple JPG, PNG and GIF image files.

```php
echo ( new HivePress\Fields\File(
	[
		'name'     => 'custom_field',
		'label'    => 'Custom field',
		'formats'  => [ 'jpg', 'png', 'gif' ],
		'multiple' => true,
		'required' => true,
	]
) )->render();
```
