diff --git a/custom/conf/app.example.ini b/custom/conf/app.example.ini index a15b9be54fc04..2912a0584e208 100644 --- a/custom/conf/app.example.ini +++ b/custom/conf/app.example.ini @@ -745,7 +745,7 @@ ENABLED = true ; Path for attachments. Defaults to `data/attachments` PATH = data/attachments ; One or more allowed types, e.g. "image/jpeg|image/png". Use "*/*" for all types. -ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/gzip +ALLOWED_TYPES = image/jpeg|image/png|application/zip|application/x-zip-compressed|application/gzip ; Max size of each file. Defaults to 4MB MAX_SIZE = 4 ; Max number of files per upload. Defaults to 5 diff --git a/modules/setting/setting.go b/modules/setting/setting.go index f98addb3cdd3f..bb1e53e94953e 100644 --- a/modules/setting/setting.go +++ b/modules/setting/setting.go @@ -839,7 +839,7 @@ func NewContext() { if !filepath.IsAbs(AttachmentPath) { AttachmentPath = path.Join(AppWorkPath, AttachmentPath) } - AttachmentAllowedTypes = strings.Replace(sec.Key("ALLOWED_TYPES").MustString("image/jpeg,image/png,application/zip,application/gzip"), "|", ",", -1) + AttachmentAllowedTypes = strings.Replace(sec.Key("ALLOWED_TYPES").MustString("image/jpeg,image/png,application/zip,application/x-zip-compressed,application/gzip"), "|", ",", -1) AttachmentMaxSize = sec.Key("MAX_SIZE").MustInt64(4) AttachmentMaxFiles = sec.Key("MAX_FILES").MustInt(5) AttachmentEnabled = sec.Key("ENABLED").MustBool(true)