---
title: "getAttachment"
canonical: "https://support.appfire.com/space/PSCONF/15302909/getAttachment"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | getAttachment(pageId, attachmentName) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Returns CAttachment with the following fields: id, pageId, spaceKey, version, creationDate, lastModificationDate, size, name.

Returns CAttachment with the following fields: id, pageId, spaceKey, version, creationDate, lastModificationDate, size, name.

## Return Type

**[CAttachment ](https://appfire.atlassian.net/wiki/spaces/PSCONF/pages/15303915)**

Returns CAttachment if the attachment was found and returns null if the page/attachment is missing.

## Example

```javascript
CAttachment attachmentInfo = getAttachment(11800, "attachment.txt");
return attachmentInfo.name;
```

## See also

> Macro (contentbylabel)