> For the complete documentation index, see [llms.txt](https://help.cosmobots.io/help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.cosmobots.io/help/outros/dicas/validar-arquivos.md).

# Validar arquivos

Você possui uma etapa em seu fluxo que pede ao cliente um arquivo, uma imagem, um documento ou um áudio? \
Saiba que você consegue estar validando se a mensagem enviada pelo cliente foi realmente um arquivo ou foi apenas uma mensagem de texto.

{% embed url="<https://drive.google.com/file/d/13yzd-uvLBveWsDnUK40pEsBrW3ipRt_V/view?usp=sharing>" %}

Construção passo a passo:

1. Em seu fluxo, crie uma [**etapa de mensagem**](/help/bot-builder/fluxo-da-conversa/mensagem.md#como-criar-uma-mensagem) que seja a solicitante do arquivo;<br>
2. Nesta etapa de mensagem, ative a opção **Salvar Resposta**, utilize uma variável de **Contexto**, com um nome de fácil entendimento, tal como "Arquivo";<br>

   <figure><img src="/files/7pa9JR8xgGerygfnGLvH" alt=""><figcaption></figcaption></figure>
3. Clique em Salvar;
4. Abaixo desta **etapa de mensagem**, insira uma etapa de [**Filtro**](/help/bot-builder/fluxo-da-conversa/filtro.md)**;**\
   [![Image from Gyazo](https://i.gyazo.com/76815fa765f9cb07ca960fa4878d89cf.gif)](https://gyazo.com/76815fa765f9cb07ca960fa4878d89cf)

{% hint style="warning" %}
Esta é a etapa que irá realizar a validação dos tipos de arquivos, então configure-a conforme o vídeo acima.
{% endhint %}

5\. Agora, selecione o campo de **Contexto;**

6\. Em **Condição**, selecione "Conté&#x6D;**";**

7\. Os valores são referentes ao que foi enviado pelo contato, neste caso, precisamos validar se foi um arquivo.

8\. Para validar se foi um arquivo, adicione o seguinte valor:

Copie este link e cole em valor:   **<https://s3.amazonaws.com/cosmo-attachments/>**

<figure><img src="/files/9nLqWSwF2AYPzMtS5Tih" alt=""><figcaption></figcaption></figure>

9\. Abaixo, repita os mesmos processos da 6., 7., e insira o seguinte valor:

Copie este link e cole em valor:   **<https://filemanager.gupshup.io/wa/>**

<figure><img src="/files/yy99rNvfuaDrlu98qPCz" alt=""><figcaption></figcaption></figure>

10\. Repita o mesmo processo que as duas anteriores, e insira o seguinte valor:

Copie este link e cole em valor:   **<https://cosmobots.s3.amazonaws.com>**

<figure><img src="/files/YayovEU6kPJB1UpSZ5EK" alt=""><figcaption></figcaption></figure>

11\. Em **SIM**, você seguirá o fluxo do seu bot, seja com suas opções de cadastro, ou outros.

12\. Em **NÂO**, você inserirá uma forma de forçar o usuário a reenviar um arquivo, tal como demonstrado no vídeo.

Pronto, agora você está validando os arquivos enviados pelos contatos, e conseguirá ter um pouco mais de controle sobre a organização.

{% hint style="danger" %}
Esta forma de validar, apenas verifica se o contato realizou o upload de um arquivo, seja ele áudio, vídeo, imagens ou documentos.&#x20;
{% endhint %}

<br>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://help.cosmobots.io/help/outros/dicas/validar-arquivos.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
