fix(fs): copy file if symlink failed (#3368)

This commit is contained in:
NewbieOrange
2023-02-13 14:41:35 +08:00
committed by GitHub
parent e1b6368343
commit 22843ffc70
2 changed files with 24 additions and 8 deletions

View File

@ -43,7 +43,7 @@ func getFileStreamFromLink(file model.Obj, link *model.Link) (*model.FileStream,
} else if link.FilePath != nil {
// create a new temp symbolic link, because it will be deleted after upload
newFilePath := stdpath.Join(conf.Conf.TempDir, fmt.Sprintf("%s-%s", uuid.NewString(), file.GetName()))
err := os.Symlink(*link.FilePath, newFilePath)
err := utils.SymlinkOrCopyFile(*link.FilePath, newFilePath)
if err != nil {
return nil, err
}