下发完成后,关闭ftp连接

This commit is contained in:
mgw
2023-02-27 09:52:17 +08:00
parent 8247acb79a
commit 57d403d754
3 changed files with 12 additions and 1 deletions

View File

@@ -78,6 +78,13 @@ class FtpController:
with open(localpath, mode='rb') as file:
self.ftp.storbinary('STOR ' + remotepath, file, bufsize)
# 关闭连接
def close_ftp(self):
"""
下发完成后关闭ftp连接减少资源损耗
"""
self.ftp.close()
def delAllfile(self, ftppath):
"""