> For the complete documentation index, see [llms.txt](https://iris-go.gitbook.io/iris/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://iris-go.gitbook.io/iris/responses/binary.md).

# Binary

**Content-Type: "application/octet-stream"**

A MIME attachment with the content type `"application/octet-stream"` is a **binary** file. Typically, it will be an application or a document that must be opened in an application, such as a spreadsheet or word processor. If the attachment has a filename extension associated with it, you may be able to tell what kind of file it is. A .exe extension, for example, indicates it is a Windows or DOS program (executable), while a file ending in .doc is probably meant to be opened in Microsoft Word.

No matter what kind of file it is, an application/octet-stream attachment **is rarely viewable** in web client. After downloading an attachment users must then open the attachment in the appropriate application to view its contents.

The `Context.Binary(data)` is the method which sends binary responses to the client. It accepts `[]byte` value.

```go
func handler(ctx iris.Context) {
    ctx.Binary([]byte("Some binary data here."))
}
```

You may also want to see the following methods for serving files:

{% content-ref url="/pages/-MAuOmE\_tHuEAlZ7s07F" %}
[Serve files from Context](/iris/file-server/context-file-server.md)
{% endcontent-ref %}
