Cannot attach a tar.gz file to a release #1104

Closed
opened 2025-11-02 03:48:50 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @thmo on GitHub (Sep 28, 2017).

  • Gitea version (or commit ref): 1.2.0+rc3
  • Git version: 2.11.0
  • Operating system: Debian GNU/Linux 9 (stretch)
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite

Description

When trying to attach a .tar.gz file (or other *.gz files), the icon shown for the uploaded file shows a cross sign and the tooltip says "file type is not allowed", and the file is then consequently ignored when creating or updating a release.

On a related note, the upload dialog presented by the browser per default only accepts .png, .jpg, .zip and .gz files (with the latter then being rejected in a second step, as described above). I don't think that limitation is reasonable, as one may want to attach any type of artifacts to a release, e.g. executables. Not sure if that qualifies for a separate issue.

Originally created by @thmo on GitHub (Sep 28, 2017). - Gitea version (or commit ref): 1.2.0+rc3 - Git version: 2.11.0 - Operating system: Debian GNU/Linux 9 (stretch) - Database (use `[x]`): - [ ] PostgreSQL - [X] MySQL - [ ] MSSQL - [ ] SQLite ## Description When trying to attach a .tar.gz file (or other *.gz files), the icon shown for the uploaded file shows a cross sign and the tooltip says "file type is not allowed", and the file is then consequently ignored when creating or updating a release. On a related note, the upload dialog presented by the browser per default only accepts .png, .jpg, .zip and .gz files (with the latter then being rejected in a second step, as described above). I don't think that limitation is reasonable, as one may want to attach any type of artifacts to a release, e.g. executables. Not sure if that qualifies for a separate issue.
GiteaMirror added the type/question label 2025-11-02 03:48:50 -06:00
Author
Owner

@lafriks commented on GitHub (Sep 28, 2017):

There are multiple content types for tar.gz and only one is allowed by default. To allow others need to add them to allowed list in app.ini

@lafriks commented on GitHub (Sep 28, 2017): There are multiple content types for tar.gz and only one is allowed by default. To allow others need to add them to allowed list in app.ini
Author
Owner

@thmo commented on GitHub (Oct 21, 2017):

With this

[attachment]
ALLOWED_TYPES = application/gzip|application/x-gzip|application/x-gtar|application/x-tgz

in custom/conf/app.ini, I can indeed upload a foo.tar.gz, but still not a foo.tgz. What would be the mime-type for that?

But more interestingly, what is the instance labeling the uploaded file with a mime-type - is that my browser? And if so, how can I see what mime-type it thinks some file has?

@thmo commented on GitHub (Oct 21, 2017): With this ``` [attachment] ALLOWED_TYPES = application/gzip|application/x-gzip|application/x-gtar|application/x-tgz ``` in `custom/conf/app.ini`, I can indeed upload a `foo.tar.gz`, but still not a `foo.tgz`. What would be the mime-type for that? But more interestingly, what is the instance labeling the uploaded file with a mime-type - is that my browser? And if so, how can I see what mime-type it thinks some file has?
Author
Owner

@lafriks commented on GitHub (Oct 22, 2017):

In windows it's in registry, Linux /usr/share/applications/*.desktop files

@lafriks commented on GitHub (Oct 22, 2017): In windows it's in registry, Linux /usr/share/applications/*.desktop files
Author
Owner

@thmo commented on GitHub (Oct 28, 2017):

Ok, the mime-type I had to use for .tgz is application/x-compressed-tar.

Obviously that's not Gitea's fault, so I'm going to close the issue. I'd like to see a more user-friendly way of configuring this, but I currently don't have an idea how that would look like.

@thmo commented on GitHub (Oct 28, 2017): Ok, the mime-type I had to use for `.tgz` is `application/x-compressed-tar`. Obviously that's not Gitea's fault, so I'm going to close the issue. I'd like to see a more user-friendly way of configuring this, but I currently don't have an idea how that would look like.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#1104