Browse Source

fix: 修复压缩包解压时可能的由于父目录不存在导致的解压失败的问题 (#2099)

Co-authored-by: allyxmiko-server <allyxmiko@gmail.com>
release-1.5
Allyx 1 year ago committed by wanghe-fit2cloud
parent
commit
17062da52e
  1. 7
      backend/utils/files/file_op.go

7
backend/utils/files/file_op.go

@ -518,6 +518,13 @@ func (f FileOp) Decompress(srcFile string, dst string, cType CompressType) error
return err
}
return nil
} else {
parentDir := path.Dir(filePath)
if !f.Stat(parentDir) {
if err := f.Fs.MkdirAll(parentDir, info.Mode()); err != nil {
return err
}
}
}
fr, err := archFile.Open()
if err != nil {

Loading…
Cancel
Save