---
title: "Socket.IO: Send files (Base64)"
description: "Send a file with no public URL, embedded as Base64 in the body itself — useful for content generated on the fly."
lang: en
canonical: https://doc.apibrasil.io/socket-io/send-files-base64
markdown: https://doc.apibrasil.io/socket-io/send-files-base64.md
source: apibrasil-documentation
---

# Socket.IO: Send files (Base64)

> Send a file with no public URL, embedded as Base64 in the body itself — useful for content generated on the fly.

- **Address:** `https://socket.apibrasil.com.br`

**Parameters of this connection**

- `bearer` (required): The same Bearer Token you use on the API. It is the only parameter checked at the door: without it the connection is refused with “Token de autenticação não fornecido”, and with a token that does not validate, with “Token de autenticação inválido”.
- `channelName` (required): The room you join. It is how the service decides what to deliver to you, and it is your Profile ID — the same value the gateway uses when publishing. Without it the connection COMES UP but you join no room at all: no event arrives, and no error is shown.
- `deviceToken` (optional): It filters nothing and does not affect what you receive. It is stored and only read when you emit `send`, to become the `DeviceToken` header of the call to the gateway. Required only if you are going to send through an API that requires a device.
- `action` (optional): The API path that `send` will call — `whatsapp/sendText`, for example. It is fixed for the connection: to send through two different APIs, open two connections. Without it, `send` returns `{ error: “URL não fornecida” }` on `receive`.

**What to listen to**

- `receive` — The response to what you sent

**What the send calls:** `evolution/message/sendMedia` — Base64 file (Evolution) (Evolution API, requires DeviceToken)

Media sent as Base64, for when the file has no public URL. The content travels whole over the connection.

```json
{
  "number": "5531999999999",
  "options": {
    "delay": 1200,
    "presence": "composing"
  },
  "mediaMessage": {
    "mediatype": "image",
    "caption": "Delivery receipt",
    "media": "/9j/4AAQSkZJRgABAQAAAQABAAD…"
  }
}
```

The details of each parameter, of the frames and of the pitfalls are on the general Socket.IO page. [Socket.IO](https://doc.apibrasil.io/socket-io.md)

## See also

- Documentation index: https://doc.apibrasil.io/llms.txt
- HTML version of this page: https://doc.apibrasil.io/socket-io/send-files-base64
