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

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

## Description

> Macro (excerpt)
> 
> Copies the attachment for the provided id from one page to another.

Copies the attachment for the provided id from one page to another.

## Return Type

**Boolean (true/false) **

Returns "true" if the attachment was copied successfully and "false" otherwise. If returned "false" check the log for a detailed reason on why it failed.

## Example

```javascript
copyAttachmentById(10205, 11801);
```

Copies the attachment with id 10205 to the page with id 11801.

## See also

> Macro (contentbylabel)