Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIME-type detector cannot detect double-extensions like .tar.gz by path. #35104

Closed
rotdrop opened this issue Nov 11, 2022 · 1 comment
Closed

Comments

@rotdrop
Copy link
Contributor

rotdrop commented Nov 11, 2022

Looking at the code here

$extension = strrchr($fileName, '.');

it appears that the current implementation of the IMimeTypeDetector is not able to map double extensions like .tar.gz etc.

Please note that such extension are even part of the core distribution in resources/config/mimetypemapping.dist.json.

I stumbled over this while trying to register .tar.xz which is not part of the core distribution. The mime is registered successfully, and running

occ maintenance:mimetype:update-db

successfully updates the mimetype table and also corrects existing entries in the filecache table, but when one uploades a new file with that extension it is not recognized.

@rotdrop
Copy link
Contributor Author

rotdrop commented Nov 11, 2022

Closing as composite extension generally do not seem to have a mime-type and there still no official mime-type for the -- in Unix systems still common -- tar + compression files.

So although the distributed resources/config/mimetypemapping.dist.json lists composite extension, they are really not used in Nextcloud. I suppose it is somehow instructive to keep the unsupported composite extension for illustration purposes.

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

No branches or pull requests

1 participant