diff --git a/models/attachment.go b/models/attachment.go index 2a3bbf9c8..fdd26b8ab 100755 --- a/models/attachment.go +++ b/models/attachment.go @@ -378,7 +378,7 @@ func GetUnDecompressAttachments() ([]*Attachment, error) { func getUnDecompressAttachments(e Engine) ([]*Attachment, error) { attachments := make([]*Attachment, 0, 10) - return attachments, e.Where("decompress_state = ? and dataset_id != 0 and attachment.type = ? and (name like '%.zip' or name like '%.tar.gz')", DecompressStateInit, TypeCloudBrainOne).Find(&attachments) + return attachments, e.Where("decompress_state = ? and dataset_id != 0 and attachment.type = ? and (name like '%.zip' or name like '%.tar.gz' or name like '%.tgz')", DecompressStateInit, TypeCloudBrainOne).Find(&attachments) } func GetAllPublicAttachments() ([]*AttachmentUsername, error) { diff --git a/routers/repo/attachment.go b/routers/repo/attachment.go index a20ed9a7d..c62a7b215 100755 --- a/routers/repo/attachment.go +++ b/routers/repo/attachment.go @@ -407,7 +407,7 @@ func AddAttachment(ctx *context.Context) { } func isCanDecompress(name string) bool { - if strings.HasSuffix(name, ".zip") || strings.HasSuffix(name, ".tar.gz") { + if strings.HasSuffix(name, ".zip") || strings.HasSuffix(name, ".tar.gz") || strings.HasSuffix(name, ".tgz") { return true } return false