Controlling Confluence Attachment

Hi Everyone,

Firstly i created confluence plugin that includes event listener module. I can capture the event of creating of attachment by using

@EventListener
public void attachmentCreateEvent(AttachmentCreateEvent event){

....

}

but i want to conrol and block attachments that file extension is ".exe". how can i handle this problem ?


can i use FileUploadUtils class or something else could you help me ?


Thanks

1 answer

0 vote

Hello!

This might be of a help to you: https://jira.atlassian.com/browse/CONF-6931

We have that Feature request open, but unfortunately it seems it won't be implemented for now. At least in a near future not, but the comment from my colleague Matt in that feature is worth of trying:

"One potentially implementation would be to write a filter plugin that intercepts multipart file upload requests and rejects them based on the name or contents of each file."

I'm not a developer myself, so I might not be able to help you in this request, but I can give you some directions with this idea. I'll leave this question open as other Devs might see this and know how to implement this function.

Cheers,

Rodrigo

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 Apr 13, 2018 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...

2,927 views 27 12
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