[x]
):Despite this setting:
ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip|application/java-archive
I does not allow upload jar files.
If I set /, then the upload is allowed.
application/* also does not allow me to do that.
What should be the appropriate setting?
...
_application/java-archive_ not working on Gitea 1.9.0 either
What is the severity of this issue from your perspective?
Where did you upload? Releases or issues?
There are two allowed_types, you may changed the wrong section. I uploaded successfully on my local instance both the releases and issues.
[repository.upload]
ALLOWED_TYPES = "application/zip|application/gzip|application/x-gzip|application/x-gtar|application/x-tgz|application/x-compressed-tar|application/java-archive"
[attachment]
ALLOWED_TYPES = "application/zip|application/gzip|application/x-gzip|application/x-gtar|application/x-tgz|application/x-compressed-tar|application/java-archive"
Where did you upload? Releases or issues?
releases
Hmm, this is interesting.
$ mkdir -p data/tmp/uploads
$ chown ...
$ service gitea restart
And it starts working.
However, after second restart, it stops working, because the tmp directory is gone!
In fact I investigated the following scenarios:
no [repsitory.upload] section in app.ini
-> no success, even if the directory is created.
[repository.upload]
ENABLED = true
TEMP_PATH = data/tmp/uploads
FILE_MAX_SIZE = 3
MAX_FILES = 5
ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip|application/java-archive
It works after first service restart if the directory is created. It does not work after the second restart, the tmp directory is gone.
Directory created, service restarted.
No success
So I got lost, I have no idea
You should try mount tmp as volume in docker
I don't use docker.
Hmm, this is interesting.
$ mkdir -p data/tmp/uploads
$ chown ...
$ service gitea restart
And it starts working.
However, after second restart, it stops working, because the tmp directory is gone!
In fact I investigated the following scenarios:
no [repsitory.upload] section in app.ini
-> no success, even if the directory is created.
[repository.upload]
ENABLED = true
TEMP_PATH = data/tmp/uploads
FILE_MAX_SIZE = 3
MAX_FILES = 5
ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip|application/java-archive
It works after first service restart if the directory is created. It does not work after the second restart, the tmp directory is gone.
Directory created, service restarted.
No success
So I got lost, I have no idea
Is it a bug or do I miss something?
Gitea should support upload of java archive so it must be a configuration or system problem.
To be able to debug, do you have any log of the failed upload ?
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.
I have the same issue but with .zip files. Can be reproduced on try.giteo.io using a Windows 10 PC and Chrome or Firefox.
It works using iOS! So apparently, mime type is set differently/ incorrectly using Windows 10/ Chrome or Firefox?
Yes, It is possible that browser/os use different value. You can debug the mime type in gitea log or with the network inspector on firefox and chrome.
For Chrome: https://developers.google.com/web/tools/chrome-devtools/network#load
There is no activity in the network tab. Possibly the javascript is already blocking the file from being uploaded?
You need to open the network tab before uploading the file
I did...
It'll be dropzone.js that is blocking the zip directly.
I have also same issue with zip files. It is because of mime-types from code of dropzone.js. Allowed are these image/jpeg,image/png,application/zip,application/gzip
and from Win10 with chrome when uploading zip is application/x-zip-compressed
.
Most helpful comment
I did...