mirror of
https://github.com/cloudreve/cloudreve.git
synced 2025-11-03 12:27:03 +08:00
fix: in decompress, file stream should be closed after copy it to temp file.
This commit is contained in:
2
assets
2
assets
Submodule assets updated: 4ca2d3696b...9a46182901
@ -190,6 +190,8 @@ func (fs *FileSystem) Decompress(ctx context.Context, src, dst string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer fileStream.Close()
|
||||||
|
|
||||||
tempZipFilePath = filepath.Join(
|
tempZipFilePath = filepath.Join(
|
||||||
util.RelativePath(model.GetSettingByName("temp_path")),
|
util.RelativePath(model.GetSettingByName("temp_path")),
|
||||||
"decompress",
|
"decompress",
|
||||||
@ -211,6 +213,7 @@ func (fs *FileSystem) Decompress(ctx context.Context, src, dst string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
zipFile.Close()
|
zipFile.Close()
|
||||||
|
fileStream.Close()
|
||||||
|
|
||||||
// 解压缩文件
|
// 解压缩文件
|
||||||
r, err := zip.OpenReader(tempZipFilePath)
|
r, err := zip.OpenReader(tempZipFilePath)
|
||||||
|
|||||||
Reference in New Issue
Block a user