I'm creating a custom macro... is there a way to get the path to the attachments on the current page when the macro is invoked?
Try converting the velocity from the user macro in this blogpost into pure Java:
A simpler way to view attachments in Confluence
This is the key line to look at:
${req.contextPath}${attachment.downloadPathWithoutVersion}")
Want to make your everyday Community actions directly contribute to reforestation? The Atlassian Community can achieve this goal by liking a post, attending an ACE, sending your peers kudos, and so much more!
Help us plant more trees
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.