# Attachment

Defined in: [zaun/js/index.d.ts:693](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L693)

## Constructors

### Constructor

> **new Attachment**(): `Attachment`

#### Returns

`Attachment`

## Properties

### contentType

> `readonly` **contentType**: `string`

Defined in: [zaun/js/index.d.ts:698](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L698)

***

### id

> `readonly` **id**: `string`

Defined in: [zaun/js/index.d.ts:695](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L695)

***

### message

> `readonly` **message**: [`Message`](/docs/reference/js/zaun-client/classes/message/)

Defined in: [zaun/js/index.d.ts:694](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L694)

***

### name

> `readonly` **name**: `string`

Defined in: [zaun/js/index.d.ts:696](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L696)

***

### size

> `readonly` **size**: `number`

Defined in: [zaun/js/index.d.ts:697](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L697)

## Methods

### download()

> **download**(): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>

Defined in: [zaun/js/index.d.ts:700](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L700)

The bytes, checked against the attachment's size and SHA3-256.

#### Returns

`Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>

***

### open()

> **open**(): `Promise`\<[`AttachmentReader`](/docs/reference/js/zaun-client/classes/attachmentreader/)\>

Defined in: [zaun/js/index.d.ts:703](https://github.com/zaunchat/zaun-client/blob/main/zaun/js/index.d.ts#L703)

The file to read while it downloads, once its first chunk is here and the file's length
is the attachment's. The host's download permission and limits apply as for `download`.

#### Returns

`Promise`\<[`AttachmentReader`](/docs/reference/js/zaun-client/classes/attachmentreader/)\>
