修改ftp下载
This commit is contained in:
@@ -100,16 +100,16 @@ class Order:
|
||||
else:
|
||||
return "Fail"
|
||||
# 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()
|
||||
linux_path = os.getcwd().replace('\\', '/')
|
||||
# 判断FTP执行类型:(下载/登录)
|
||||
# 调用cmd执行FTP下载文件
|
||||
data = 'curl -m 20 '+ftp_url+ '-o '+ fiel_name + " ' "
|
||||
data = 'curl -m 20 '+ftp_url+ '-o '+ file_name + " ' "
|
||||
print(data)
|
||||
d = self.CMD(data)
|
||||
sleep(5)
|
||||
fsize = os.path.getsize(linux_path + "/"+fiel_name) # 435814
|
||||
fsize = os.path.getsize(linux_path + "/"+file_name) # 435814
|
||||
print(fsize)
|
||||
if fsize == file_size:
|
||||
return "Success"
|
||||
|
||||
Reference in New Issue
Block a user