> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SaveAttachment

> Use SaveAttachment in the ABBYY FlexiCapture API to add an attachment File to a specified document, page, or batch object on the Application Server.

## What it does

Adds attachment to the specified object.

## Definition

```
void SaveAttachment( int sessionId, int type, int objectId, int batchId, int projectId, File file );
```

## Parameters

<table width="100%"><tbody><tr><td><p><strong>Name</strong></p></td><td><p><strong>Type</strong></p></td><td><p><strong>Description</strong></p></td></tr><tr><td><p>sessionId</p></td><td><p>int</p></td><td><p>The ID of the connection to the Application Server</p></td></tr><tr><td><p>type</p></td><td><p>int</p></td><td><p>Type of attachment. Possible values</p><ul><li><strong>9</strong> - attachment to a document;</li><li><strong>10</strong> - attachment to a page;</li><li><strong>11</strong> - attachment to a batch.</li></ul></td></tr><tr><td><p>objectId</p></td><td><p>int</p></td><td><p>The ID of the object</p></td></tr><tr><td><p>batchId</p></td><td><p>int</p></td><td><p>The ID of the batch</p></td></tr><tr><td><p>projectId</p></td><td><p>int</p></td><td><p>The ID of the project</p></td></tr><tr><td><p>file</p></td><td><p><a href="/flexi-capture/api/structures/file">File</a></p></td><td><p>Attachment file</p></td></tr></tbody></table>

## Returned value

None.
