gitea: Cannot upload file of this type to a release (zip)
- Gitea version (or commit ref): 1.6.3, 1.7.0, 1.7.1
- Git version: 2.20.1
- Operating system: Windows 10 x64
- Database (use
[x]):- PostgreSQL
- MySQL
- MSSQL
- SQLite
- Can you reproduce the bug at https://try.gitea.io:
- Yes (https://try.gitea.io/ve3/test/src/tag/0.1)
- No
- Not relevant
Description
I tried to upload a file to a release but got error message “You cannot upload files of this type”. The file is zip and its mime type is application/zip.
Here is app.ini configuration.
[attachment]
ENABLED = true
PATH = D:/my-work-spaces/gitea/data/attachments
ALLOWED_TYPES = application/zip|application/x-compressed-tar|application/x-gzip
MAX_SIZE = 20
MAX_FILES = 1
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 30 (18 by maintainers)
This is work for me. thanks.
I got today the same problem. I tried drag&drop and upload by clicking (file open dialogue).
My parameter are like this:
[x]):This setting helped for me:
TestZipFile.zip
File:
TestZipFile.txtContent:This file is test file+ new line (CR+LF) Zipped using 7z version 19.00For release, you should change
repository.uploadsection notattachmentSame here on latest 1.7.1, it won’t let me upload zip files even though they are explicitly allowed.
Workaround: add
application/x-zip-compressedtoALLOWED_TYPES