Link to a pdf file

Enonic version: 6.x
OS: centos


On an enonic XP site I upload a pdf file with Content Studio. I would like to make this file readable for public. How can we refer to this file as a link? The file was uploaded as media content.

The designed link would be something like
It seems that there is no simple way to do this.


Hi! Use attachmentUrl function to get link to the file.

On XP 6.x you can combine tsi’s suggestion above with the Attachment Viewer application from Enonic Market, which lets you view the attachmentUrl to the PDF inline in the browser instead of downloading it.

(The app has become redundant in Enonic XP 7.x)

1 Like

Can I ask a follow up question to this. You write that the app will be redundant in XP7, is that because there is an integrated pdf viewer already?

Indeed, in XP7 PDFs are rendered in the preview window just like images are.