Fixed issue with ftp temp folder

The ftp files wouldn't get downloaded in the TempSFTPFolder and this would result in a crash
This commit is contained in:
Neocky 2023-02-09 20:18:21 +01:00
parent 30f0dd91ac
commit 1fda453bbd

View File

@ -136,22 +136,24 @@ def ftp_list_files_in_server_root(ftp):
rich_print_error("Error: [FTP]: No Serverjar was found.")
def ftp_download_file(ftp, path_download, file) -> None:
def ftp_download_file(ftp, file) -> None:
"""
Download a file of the ftp server
:param ftp: ftp connection
:param path_download: Path to save downloaded file to
:param file: File to download
:returns None
"""
config_values = config_value()
ftp.cwd(config_values.remote_plugin_folder_on_server)
current_directory = os.getcwd()
os.chdir('TempSFTPFolder')
filedata = open(path_download,'wb')
ftp.retrbinary('RETR '+file, filedata.write)
filedata.close()
ftp.quit()
os.chdir(current_directory)
return None