Adds an attachment to a selected page.

Return Type

Boolean (true/false)

The return value represents the success of adding the attachment. If the routine returns true the attachment was successfully added.


1 2 3 4 5 string path_to_file; number page; path_to_file = "C:/confluence/home/attachment/file_to_attach_1.jpg"; page = 11801; attachFile(path_to_file, page);

Result: Returns true if the file is at the selected location and the issue exists. It means the file was attached. Returns false if any of the conditions stated before are not met.

Use forward slashes ("/") for the path. The path to the attachment must be absolute and point to a location on the server. If an error occurs, the routine will return false and the error message will be visible in the log.

See also