|
|
|
@ -5,7 +5,6 @@ import ( |
|
|
|
"os" |
|
|
|
"path" |
|
|
|
"path/filepath" |
|
|
|
"scagent/config" |
|
|
|
"scagent/util" |
|
|
|
"strings" |
|
|
|
"time" |
|
|
|
@ -26,8 +25,9 @@ type FileChunk struct { |
|
|
|
|
|
|
|
// 压缩文件
|
|
|
|
type ZipBlock struct { |
|
|
|
Curpath string // 当前路径
|
|
|
|
SelFile []string // 选中的文件
|
|
|
|
Basepath string |
|
|
|
Curpath string // 当前路径
|
|
|
|
SelFile []string // 选中的文件
|
|
|
|
} |
|
|
|
|
|
|
|
// Upload 接收文件分片并写入到本地文件
|
|
|
|
@ -60,7 +60,7 @@ func (f *FileService) Compress(args *ZipBlock, reply *string) error { |
|
|
|
logger := util.NewProductionLogger() |
|
|
|
defer logger.Sync() |
|
|
|
// 实际路径
|
|
|
|
realFilePath := filepath.Join(config.G.FilePath, args.Curpath) |
|
|
|
realFilePath := filepath.Join(args.Basepath, args.Curpath) |
|
|
|
// zip 文件名
|
|
|
|
zpFileName := "BIU_" + time.Now().Format("20060102_150405") + ".zip" |
|
|
|
// 创建zip 异步?
|
|
|
|
|