How I can add an attachment without onclick preview (direct download)
Asked by Evgeniy Udodov:

I'm using Confluence 5.7. I add an attachment to page. Users want to download it with one click but they see black full screen preview (empty because of file type) with tiny download button in upper right corner. It's okay for images but only for them.

I see the same problem in Atlassian documentation pages with Confluence 5.8.


Answers:
author: Scott Selberg
body: Hi,

This seems to be a new "Feature" of Confluence 5.7. All attachments are previewed before downloading - even if previewing doesn't make sense. Here's the Bug/Features request: <https://jira.atlassian.com/browse/CONF-36632>

I don't like any of the workarounds as they take a lot of work to implement, and then just as much if not more to maintain and remove when Confluence starts to behave nicely again (regarding this aspect). My workaround is a macro to create a direct download link. At present, it's just the macro to create the link. When confluence allows direct downloads, I'd like to write a second macro to perform a search and replace to get rid of the workaround and put link into the correct syntax again.

<https://bitbucket.org/selberg/download-attachment>

-Scott

comments: author: Evgeniy Udodov
body: Thank you


author: Matin Schiemann
body: Thank you too, Scott. Works like a charm.

Best

Matin


author: Kirstin Seidel-Gebert
body: Nice work, Scott.  
Would it be possible to add a link on an image with this add-on?

Regards,  
Kirstin


body: Easiest workaround I could find out:

1. Attach your file to the page (not insert, just attach)

2. Create a link to the attachment.


author: Matin Schiemann
body: Hi all, just to let you know: This is a feature request in <https://jira.atlassian.com/browse/CONF-36736>

Best

Matin


author: Christian Sprenger
body: Another nice "feature" which you neither can configure nor can disable.

I like the features but as Admin you'd be able at least to disable them **without** modifying the source code .


author: Kirstin Seidel-Gebert
body: Hallo Evgeniy,

what kind of content causes this? How do you embed the link to the attachment to your Confluence page?

We have images on our Confluence page that are linking to ZIP files. Clicking an image results in a direct download.

Cheers,  
Kirstin

comments: author: Evgeniy Udodov
body: Edit page -\> Files (on top menu) -\> Attachment to this page -\> Upload files (upload my zip file) -\> Insert. After these actions I've got the file link (or thumbnail, it's works the same) which shows preview popup on click. How you make an image with attachment and direct download? Do you use confluence 5.7? It's started in latest versions.


author: Kirstin Seidel-Gebert
body: We' re still using Confluence 5.5.2. No time to upgrade yet. :)To create an image with a link, add the desired image to the page. Then click the image and select "Link" from the context menu. You can add a link to the attachment there.The procedure you described seems to be Confluence 5.7 specific. I'm missing the Files menu in Confluence 5.5.2.


author: Evgeniy Udodov
body: Images also shows preview. It's new feature (bug) in confluence.Atlassian themselves have the same problem on confluence.atlassian.comFor example this csv file: <https://confluence.atlassian.com/display/CROWD/Importing+Users+from+CSV+Files?preview=/64454760/65634312/example_users_file.csv>


Tags: confluence-administration