Attachment url as parameter in another url

I'm trying to build a Link that contains a parameter which is the URL of an attachment. Something like this:


I don't have access to user macros and I don't have control over the installed plugins, so I'm working with a mostly stock Confluence 3.5 install. I don't have the Script plugin, but I do have the Run plugin. I've tried a few things with the Run plugin, but I can't quite get what I want. For example:

[Test | h t t p://$url]

Can anyone suggest another approach?



3 answers

0 vote
Joseph Clark Atlassian Team Dec 20, 2011

So the problem with your current approach is that you just want the filename and extension, rather than the full absolute URL to the attachment?

I do want the full absolute URL, and that is actually what I'm getting. But what I also want is that URL to be interpolated into a hyperlink. The problem that I'm running into is that I can't get the hyperlink to work properly.

If I use "replace=url:[^attachment.ext]" then the hyperlink isn't formed correctly, (i.e. this is the generated HTML):

[Test | h t t p://<a href="/download/attachments/12345/attachment.ext?version=1&...>attachment.ext</a>

If I use "replace=url:^attachment.ext" then the hyperlink results in an error:

<span class="error">[Test | h t t p://^attachment.ext]</span>

Ultimately what i want is for the HTML to look something like this:

<a ... href="h t t p:// t t p://confluence/download/attachments/12345/attachment.ext?version=1&...">Test</a>

I'm not sure if this is possible with the Run plugin, but this is the best approach that I've found so far.

[The "h t t p" above is my attempt to avoid parse errors in OSQA - read those as "http"]

0 vote
Joseph Clark Atlassian Team Dec 20, 2011

I'm not sure if that's going to be possible or not :-( It seems like the run macro is a good approach if you don't have the ability to customise Confluence at all or install any plugins.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Friday in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

273 views 11 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you