mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 17:41:57 +08:00
Feat: add ".zip" suffix if not specified while creating compressed file
This commit is contained in:
@@ -146,6 +146,11 @@ func (service *ItemCompressService) CreateCompressTask(c *gin.Context) serialize
|
||||
return serializer.Err(serializer.CodeGroupNotAllowed, "当前用户组无法进行此操作", nil)
|
||||
}
|
||||
|
||||
// 补齐压缩文件扩展名(如果没有)
|
||||
if !strings.HasSuffix(service.Name, ".zip") {
|
||||
service.Name += ".zip"
|
||||
}
|
||||
|
||||
// 存放目录是否存在,是否重名
|
||||
if exist, _ := fs.IsPathExist(service.Dst); !exist {
|
||||
return serializer.Err(serializer.CodeNotFound, "存放路径不存在", nil)
|
||||
|
||||
Reference in New Issue
Block a user