Rename upload before they appear as attachments

Tuelle
Contributor
June 23, 2017

Hi,

I want to add a timestamp to the filename of uploaded attachments so that each new upload is a new attachment and not a new version if the filename already exists. I managed to implement a servlet filter that performs the required action for drag and drop upload, but I don't know how to handle uploads through the upload panel?

Is it possible to change the name in the multipart request during upload?

Or can I hook in some handler that renames every new upload before it apears as an attachment? 

Or can I write a custom upload handle?

1 answer

0 votes
Fabio Racobaldo _Herzum_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 10, 2024

Hi @Tuelle ,

you need to intercept upload action (you need to extend AttachFileAction in a plugin) and perform rename on execute method.

Hope this helps,

Fabio

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events