修改ftp下载

This commit is contained in:
朱明明
2020-04-14 17:29:28 +08:00
parent 07072d89a5
commit e61d81aad5

View File

@@ -100,16 +100,16 @@ class Order:
else: else:
return "Fail" return "Fail"
# FTP 下载 # FTP 下载
def FTP_down(self, ftp_url,file_size,fiel_name): def FTP_down(self, ftp_url,file_size,file_name):
windows_path = os.getcwd() windows_path = os.getcwd()
linux_path = os.getcwd().replace('\\', '/') linux_path = os.getcwd().replace('\\', '/')
# 判断FTP执行类型下载/登录) # 判断FTP执行类型下载/登录)
# 调用cmd执行FTP下载文件 # 调用cmd执行FTP下载文件
data = 'curl -m 20 '+ftp_url+ '-o '+ fiel_name + " ' " data = 'curl -m 20 '+ftp_url+ '-o '+ file_name + " ' "
print(data) print(data)
d = self.CMD(data) d = self.CMD(data)
sleep(5) sleep(5)
fsize = os.path.getsize(linux_path + "/"+fiel_name) # 435814 fsize = os.path.getsize(linux_path + "/"+file_name) # 435814
print(fsize) print(fsize)
if fsize == file_size: if fsize == file_size:
return "Success" return "Success"