# Upload de arquivo

## Estrutura

```javascript
{
    "default": {
        "type": "file_upload",
        "payload": {
            "maxFileSize": "10M",
            "acceptFileTypes": "PNG|JPEG|PDF|DOC|MP4|DOCX|XLSX|PPTX",
            "btnCancel": false,
            "btnCancelLabel": "Cancelar",
            "description": "descrição axmld"
        }
    }
}
```

## Atributos

* **type:** file\_upload
* **payload:**&#x20;
  * **maxFileSize:** tamanho máximo permitido do arquivo é de 10M
  * **acceptFileTypes**: formatos dos arquivos aceitos para upload.&#x20;
    * É possível editar e incluir outras extensões, como: .JPG .JPEG .PNG .PDF .DOC .DOCX .XLS .XLSX .PPT .PPTX .MP3 .MPGA .OGG .OGA .AAC .MP4
  * **btnCancel (opcional)**: se passado o valor true, mostra botão de cancelar upload
  * **btnCancelLabel (opcional)**: título do botão de cancelar upload
    * Se o upload for cancelado é retornado a mensagem `ALTU_FILE_UPLOAD_CANCEL` no `input.text`
  * **Descrição (opcional):** texto de descrição do arquivo com no máximo 240 caracteres

Neste exemplo o usuário só poderá fazer upload de arquivos de no máximo 10MB e nos formatos .jpg, .png e .pdf.

## Exemplo

{% tabs %}
{% tab title="Exemplo" %}

```javascript
{
    "default": {
        "type": "file_upload",
        "payload": {
            "maxFileSize": "10M",
            "acceptFileTypes": "PNG|JPEG|PDF|DOC|MP4|DOCX|XLSX|PPTX"
        }
    }
}
```

{% endtab %}

{% tab title="Preview no Widget" %}
![](/files/-MDWSQnPZJ7jjVDBaN_6)
{% endtab %}
{% endtabs %}

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.altu.d1.cx/build/assistentes/builder/componentes/input/file_upload.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
