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

PPTX and other formats are badly recognized and downloaded with .zip extenstions #15748

Closed
2 of 6 tasks
dusatvoj opened this issue May 6, 2021 · 4 comments
Closed
2 of 6 tasks
Labels

Comments

@dusatvoj
Copy link

dusatvoj commented May 6, 2021

  • Gitea version (or commit ref): 1.14.0
  • Git version: 2.20.1
  • Operating system: Debian 10
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
  • Log gist:

Description

Some people in our company have a problem when they upload pptx or docx or another OfficeOpenXML. It's downloaded with .zip extension bcs it's badly recognized. It's not happening in linux but in windows because it's zip mime type (some shitty windows stuff but it's annoying for them when they download presentation.pptx.zip). In linux is downloaded as pptx but with zip mime type (extension does not change)
I can understand why it's happening but I can't understand why mime type is not set by extension.

Screenshots

@lunny lunny added the type/bug label May 7, 2021
@sapk
Copy link
Member

sapk commented May 9, 2021

We use go standard lib mime.TypeByExtension in Gitea to determine mime types on server side.
It is based on the host configuration: https://golang.org/src/mime/type.go?s=2843:2882#L91

Maybe you can add those mime types to the host list (and restart gitea after )?

On our side we could maybe add some extra not available on most OS distribution ?

@dusatvoj
Copy link
Author

dusatvoj commented May 9, 2021

I have Debian 10 on server and mime.types has extension pptx defined as below.

application/vnd.openxmlformats-officedocument.presentationml.presentation       pptx

But pptx is downloaded as zip mime type (screenshot below) ...
Screenshot

Tested in latest firefox on linux

@zeripath
Copy link
Contributor

This can now be solved with #15133

@techknowlogick
Copy link
Member

Closing per linked PR

@go-gitea go-gitea locked and limited conversation to collaborators Oct 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants