> ## 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.

# LoadAttachment

> Use LoadAttachment in the ABBYY FlexiCapture API to download an attachment from a document, page, or batch as a File object, with a default 100 MB limit.

## What it does

Gets attachment as a file.

By default, this method can download files of up to 100 MB. This file size restriction can be disabled or modified using Internet Information Services (IIS) Manager.

To set the maximum size of downloaded files:

* Navigate to *\Sites\Default Web Site\FlexiCapture12\Server > Application Settings*.
* Locate the *MaxAttachmentSizeForSoap* key and specify the file size in bytes. (Setting this key to 0 will disable the file size restriction.)

<Note>
  To download large files, we recommend using a [file storage](/flexi-capture/api/files/files).
</Note>

## Definition

```
File LoadAttachment( int sessionId, int type, int objectId, int batchId, int projectId, string fileName );
```

## 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>session</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>fileName</p></td><td><p>string</p></td><td><p>The name of the attachment file to be retrieved from the Application Server</p></td></tr></tbody></table>

## Returned value

| **Type**                                   | **Value**       |
| ------------------------------------------ | --------------- |
| [File](/flexi-capture/api/structures/file) | Attachment file |
