From b54c79e196ff14b18eab52d50dd51e6862fe4573 Mon Sep 17 00:00:00 2001 From: Allyx <53589496+allyxmiko@users.noreply.github.com> Date: Mon, 28 Aug 2023 22:37:48 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8E=8B=E7=BC=A9?= =?UTF-8?q?=E5=8C=85=E8=A7=A3=E5=8E=8B=E6=97=B6=E5=8F=AF=E8=83=BD=E7=9A=84?= =?UTF-8?q?=E7=94=B1=E4=BA=8E=E7=88=B6=E7=9B=AE=E5=BD=95=E4=B8=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E5=AF=BC=E8=87=B4=E7=9A=84=E8=A7=A3=E5=8E=8B=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98=20(#2099)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: allyxmiko-server --- backend/utils/files/file_op.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/utils/files/file_op.go b/backend/utils/files/file_op.go index aba4d1cd8..63e3ecad3 100644 --- a/backend/utils/files/file_op.go +++ b/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 {