-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Cannot upload jar file #7266
Comments
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"
|
releases |
Hmm, this is interesting. $ mkdir -p data/tmp/uploads And it starts working.
[repository.upload] 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.
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 And it starts working.
[repository.upload] 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.
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. |
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. |
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. |
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 |
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 |
- Add support for file extensions, matching the `accept` attribute of `<input type="file">` - Add support for type wildcard mime types, e.g. `image/*` - Create repository.release.ALLOWED_TYPES setting (default unrestricted) - Change default for attachment.ALLOWED_TYPES to a list of extensions - Split out POST /attachments into two endpoints for issue/pr and releases to prevent circumvention of allowed types check Fixes: go-gitea#10172 Fixes: go-gitea#7266 Fixes: go-gitea#12460 Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers
) * Attachments: Add extension support, allow all types for releases - Add support for file extensions, matching the `accept` attribute of `<input type="file">` - Add support for type wildcard mime types, e.g. `image/*` - Create repository.release.ALLOWED_TYPES setting (default unrestricted) - Change default for attachment.ALLOWED_TYPES to a list of extensions - Split out POST /attachments into two endpoints for issue/pr and releases to prevent circumvention of allowed types check Fixes: #10172 Fixes: #7266 Fixes: #12460 Ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Unique_file_type_specifiers * rename function * extract GET routes out of RepoMustNotBeArchived Co-authored-by: Lauris BH <[email protected]>
[x]
):Description
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?
...
Screenshots
The text was updated successfully, but these errors were encountered: