linkFile(embeddedId, [filename]) Last updated: 13. May 2026

Creates the link to an embedded file within the current document. This function is only available for display templates for document schemas.

See also: Path traversal

Parameters

Name Type Description
embeddedId string

Embedded file ID for file to create link to.

filename (optional) string

Specify a filename for this embedded file.

Returns

A string with the link to the file.

Example

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
<a href="#docly.linkFile(File1)#">Open file</a>

Use the download attribute to force download file:
<a href="#docly.linkFile(File1)#" download>Download file</a>

Output

The #JS code above produces the output shown below:
No demo available