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

A docx and xlsx attachments get renamed to .txt #510

Open
pinta83 opened this issue Jan 31, 2020 · 0 comments
Open

A docx and xlsx attachments get renamed to .txt #510

pinta83 opened this issue Jan 31, 2020 · 0 comments

Comments

@pinta83
Copy link
Contributor

pinta83 commented Jan 31, 2020

When I save a docx or a xlsx file with Libre office, the mimetype of these files are "application/octet-stream" and when uploading them as attachments - they get renamed to .txt which is not desired behavior.

I've tracked this bug down to "media/k2/assets/vendors/verot/class.upload.php/src/class.upload.php" where there is only one mimetype defined for each of the files, but as you see - they can come as both.

I've managed to fix this by adding an additional "mime_types_extra" property to the class and doing an extra "else if" check on line 2987 to check this other array for mime types.

If you like, I can make a pull request.

Here are the test files saved with Libreoffice
attachment.docx
attachment.xlsx

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