Skip to content

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

Open
@pinta83

Description

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

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions