Skip to content

Conversation

@julien-nc
Copy link
Member

@julien-nc julien-nc commented May 9, 2022

refs #2338

If foo.png is uploaded but already exists in the attachment folder, file is named foo (2).png. If uploaded again, foo (3).png. And so on.

…attachment names are unique

Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
@julien-nc julien-nc force-pushed the enh/2338/image-name-no-timestamp branch from 24dc8de to 6759366 Compare May 9, 2022 10:46
@vinicius73
Copy link
Member

@eneiluj it's possible to create a test for it to prevent regressions?

Copy link
Member

@mejo- mejo- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, works like a charm. Thanks a lot @eneiluj for looking into it 💜

One day we should add such a getUniqueFilename() function to Nextcloud itself - I already know of at least four independent implementations for that 🤪

@julien-nc
Copy link
Member Author

@vinicius73 Yes I'll create a test, thanks for the suggestion.

Signed-off-by: Julien Veyssier <eneiluj@posteo.net>
@julien-nc julien-nc force-pushed the enh/2338/image-name-no-timestamp branch from 4047a08 to c0c2964 Compare May 9, 2022 16:22
@julien-nc julien-nc merged commit 1408efd into master May 9, 2022
@delete-merged-branch delete-merged-branch bot deleted the enh/2338/image-name-no-timestamp branch May 9, 2022 16:37
@mejo-
Copy link
Member

mejo- commented May 9, 2022

We probably should backport this to stable24, no?

@mejo-
Copy link
Member

mejo- commented May 9, 2022

/backport to stable24

@julien-nc
Copy link
Member Author

@mejo- Yep!
And thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants