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

Attachment file type is not allowed #7302

Closed
1 of 7 tasks
pditommaso opened this issue Jun 26, 2019 · 6 comments
Closed
1 of 7 tasks

Attachment file type is not allowed #7302

pditommaso opened this issue Jun 26, 2019 · 6 comments
Labels
issue/stale type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@pditommaso
Copy link

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

Description

I've the following config for the attachments

[attachment]
ENABLED       = true
PATH          = /var/lib/gitea/data/attachments/
MAX_SIZE      = 4
MAX_FILES     = 5
ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip

However, when uploading a zip file it says "File type is not allowed".

Screenshots

Screenshot 2019-06-26 at 16 56 10

@vorlif
Copy link

vorlif commented Jun 26, 2019

Hi pditommaso,

please try to add:

  • application/octet-stream,
  • application/x-zip-compressed
  • multipart/x-zip

@lunny lunny added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Jun 26, 2019
@pditommaso
Copy link
Author

Tried this, still no joy:

ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip|application/octet-stream|application/x-zip-compressed|multipart/x-zip

@silverwind
Copy link
Member

File input allows specifying types by extension too, try adding the .zip extension directly:

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept

@silverwind
Copy link
Member

If above does not work, we can probably add support by it by passing the value of attachment.ALLOWED_TYPES directly to the <input>, replacing | with , in process.

@stale
Copy link

stale bot commented Aug 28, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale stale bot added the issue/stale label Aug 28, 2019
@stale
Copy link

stale bot commented Sep 11, 2019

This issue has been automatically closed because of inactivity. You can re-open it if needed.

@stale stale bot closed this as completed Sep 11, 2019
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/stale type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

4 participants