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

# attachment table

> This table contains metadata for attachments. The actual attachments are stored directly on disk, with filenames based on the the primary key for this table.

## attachment Table (296)

This table contains metadata for attachments. The actual attachments are stored directly on disk, with filenames based on the the primary key for this table.

## Fields

| Name                     | Description                                                                                                                                                                | Type                                                 | Nullable |
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | :------: |
| id                       | The primary key (auto-incremented)                                                                                                                                         | PK                                                   |    No    |
| content\_type            | The content type for the attachment (e.g. \&apos;applaction/octet-stream\&apos; or \&apos;application/vnd.openxmlformats-officedocument.wordprocessingml.document\&apos;). | String(255)                                          |    Yes   |
| name                     | The filename for the attachment.                                                                                                                                           | String(255)                                          |    Yes   |
| att\_size                | The size (in bytes) for the attachment.                                                                                                                                    | Int                                                  |    Yes   |
| auth\_key                | The key used for authenticating access to this attachment.                                                                                                                 | String(255)                                          |    Yes   |
| charset                  | The charset if this is a text attachment                                                                                                                                   | String(255)                                          |    Yes   |
| dbi\_agent\_id           | Integration agent (eJournal)                                                                                                                                               | FK [dbi\_agent](./dbi-agent.mdx)                     |    No    |
| dbi\_key                 | The primary key for the integrated entry in the external datasource.                                                                                                       | String(255)                                          |    No    |
| dbi\_last\_syncronized   | Last external syncronization.                                                                                                                                              | DateTime                                             |    No    |
| dbi\_last\_modified      | When the entry was last modified.                                                                                                                                          | DateTime                                             |    No    |
| attachment\_location\_id | The id of the attachment\_location this attachment is stored in                                                                                                            | FK [attachment\_location](./attachment-location.mdx) |    Yes   |

<img src="https://mintcdn.com/superofficeas/i6M2qZmvMNH7UTeu/media/loc/en/database/tables/attachment.png?fit=max&auto=format&n=i6M2qZmvMNH7UTeu&q=85&s=748b5903df2b3a8fd66ac7e499e2cfd8" alt="attachment table relationship diagram" width="1077" height="885" data-path="media/loc/en/database/tables/attachment.png" />

## Indexes

| Fields                 | Types       | Description |
| ---------------------- | ----------- | ----------- |
| dbi\_agent\_id         | FK          | Index       |
| dbi\_key               | String(255) | Index       |
| dbi\_last\_syncronized | DateTime    | Index       |
| dbi\_last\_modified    | DateTime    | Index       |

## Relationships

| Table                                                      | Description                                                                                                       |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| [attachment\_location](./attachment-location)              | A location for storing attachments                                                                                |
| [dbi\_agent](./dbi-agent)                                  | DBI agent settings                                                                                                |
| [doc\_document](./doc-document)                            | This table contains documents.                                                                                    |
| [ej\_message](./ej-message)                                | This table contains the messages listed under tickets.                                                            |
| [ejpackage](./ejpackage)                                   | This table stores packages on the system.                                                                         |
| [ejuser](./ejuser)                                         | This table contains entries for the users of the system.                                                          |
| [external\_document](./external-document)                  | This table stores documents which can be viewed externaly, through the customer module                            |
| [kb\_attachment](./kb-attachment)                          | This table connects FAQ entries to attachments.                                                                   |
| [reply\_template\_attachment](./reply-template-attachment) | This table is used to connect attachments to reply templates (many-to-many).                                      |
| [s\_attachment](./s-attachment)                            | A connector between a message and attachments. One message can contain many attachments.                          |
| [s\_picture\_entry](./s-picture-entry)                     | This table describes each picture in the database                                                                 |
| [ticket\_attachment](./ticket-attachment)                  | This table connects an attachment to a message. It references the entry in the attachment table, and the message. |

## Replication Flags

* None

## Security Flags

* No access control via user's Role.


## Related topics

- [ticket_attachment table](/en/database/tables/ticket-attachment.md)
- [kb_attachment table](/en/database/tables/kb-attachment.md)
- [Attachment location](/en/onsite/config/service/attachment-location.md)
- [email_attachment table](/en/database/tables/email-attachment.md)
- [reply_template_attachment table](/en/database/tables/reply-template-attachment.md)
- [QuoteVersionAttachment table](/en/database/tables/quoteversionattachment.md)
