Skip to content

Commit 8ba18d6

Browse files
committed
fix: downloader file name messed up
1 parent 4873458 commit 8ba18d6

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

core/internal/cc/base/ftp/file_transfer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func GetFile(file_path string, agent *def.Emp3r0rAgent) (ftpSh *network.StreamHa
143143
}
144144
}
145145

146-
err = util.FileAllocate(tempname, filesize)
146+
err = util.FileAllocate(save_to_file, filesize)
147147
if err != nil {
148148
err = fmt.Errorf("GetFile: %s allocate file: %v", file_path, err)
149149
return

core/internal/cc/base/ftp/handler_ftp.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ func HandleFTPTransfer(sh *network.StreamHandler, wrt http.ResponseWriter, req *
9797
return
9898
}
9999
mapKey := filename
100+
// Prepare file paths. targetFile is the final destination, filewrite is the temp file that we write to, it will be renamed to targetFile when done.
100101
writeDir, targetFile, filewrite, lock := GenerateGetFilePaths(filename)
101102
filename = filepath.Clean(filename)
102103
filename = util.FileBaseName(filename)

0 commit comments

Comments
 (0)