# File-upload

Component design:&#x20;

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FxsRrnqikec18eVwy5gTL%2Fimage.png?alt=media&#x26;token=d4f03507-90be-4b01-a350-b5677e5d99fe" alt=""><figcaption></figcaption></figure>

<figure><img src="https://691205473-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTL6WUldKvxQaP8jzz%2Fuploads%2FlxPAUUOERZJj10aGw7VS%2Fimage.png?alt=media&#x26;token=d83c749c-c762-4893-a16b-065b7ed54519" alt=""><figcaption></figcaption></figure>

How to use a component:

```php
STM_LMS_Templates::show_lms_template(
    'components/file-upload',
    array(
        'attachments'            => array(), (required)
        'allowed_extensions'     => array(), (required)
        'files_limit'            => int, (required)
        'allowed_filesize'       => int, (required)
        'allowed_filesize_label' => string, (required)
        'readonly'               => bool, (required)
        'dark_mode'              => bool, (required)
    )
);
```
