Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to get path to attachments in custom macro?

Bob Nicholson August 25, 2012

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?

1 answer

1 accepted

1 vote
Answer accepted
David at David Simpson Apps
Atlassian Partner
August 25, 2012

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}")

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, likes for trees, atlassian community, social impact, tree planting campaign, community kudos, atlassian giving, environmental impact, sustainability, likes for good, atlassian social responsibility, community challenge

Make every click count—help us plant 50,000 trees! 🌳

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
AUG Leaders

Atlassian Community Events