Skip to content
This repository has been archived by the owner on Jul 2, 2018. It is now read-only.

when assessing the uniqueness of filenames, the filename extension is disregarded (see comments) #996

Open
xrotwang opened this issue Nov 5, 2014 · 9 comments
Assignees
Milestone

Comments

@xrotwang
Copy link

xrotwang commented Nov 5, 2014

Uploading files with names a.pdf and a.mp3 fails when the check uniqueness of filenames box is checked. I think this is a bug, due to the usage of FilenameUtils.getBaseName instead of FilenameUtils.getName in https://github.com/imeji-community/imeji/blob/develop/src/main/java/de/mpg/imeji/presentation/upload/UploadBean.java

@bastiensaquet bastiensaquet self-assigned this Nov 10, 2014
@bastiensaquet bastiensaquet added this to the R 2.1.0.0 milestone Nov 10, 2014
@bastiensaquet
Copy link
Member

It is actually intended. We check the names to be able to replace the thumbnails. You might upload a.mp3 and then upload a.jpg as a thumbnail.
That is why we only check the name without the extension.
Do you have another solution for it?

@xrotwang
Copy link
Author

If it is intended, this intention should be documented, i.e. the UI should say "uniqueness of filename stem" or something along those lines.

@xrotwang
Copy link
Author

Upon second thought, I don't really understand the problem with thumbnails. I'd assume thumbnails are named in such a way that these names never collide with names for the original files. So why can't a.mp3 and a.pdf be treated as different?

@bastiensaquet
Copy link
Member

When you want to create a thumbnail for the file a.mp3, you will have to upload for instance a.jpg. We map then the new thumbnail to the orginal file via the common part, i.e the filenames without the extension: a.
If you already have to files a.mp3 and a.pdf in your collection, how to know which one is intended to get the new thumbnail.
I don't see any better solution since the filename is the only info we get about the upoloaded file.

@xrotwang
Copy link
Author

Well, you have the md5 checksum. Also, there's nothing wrong with multiple extensions; so a thumbnail for a.mp3 could be named a.mp3.jpg.

@bastiensaquet
Copy link
Member

The multiple extensions thing is a valid idea.
I will keep it as an improvement.
Thanks.

@bastiensaquet bastiensaquet changed the title when assessing the uniqueness of filenames, the filename extension is disregarded when assessing the uniqueness of filenames, the filename extension is disregarded (see comments) Jan 15, 2015
@xrotwang
Copy link
Author

I'd claim the md5 checksum idea is valid, too :) Actually, I even think it would be superior, because it would allow you to upload multiple files with the same filename and still be able to associate thumbnails with each one, using filenames like <md5sum>.jpg.

@bastiensaquet
Copy link
Member

Ok, now I understand the idea with the md5.
But that requires every user to be capable of creating a checksum, which I don't really expect.
But both method could/should be offered. Thanks for ther hints.

@natasab
Copy link

natasab commented Sep 9, 2015

Going through this ticket.. How can one actually upload explicitly a thumbnail?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants