How can I download file from ftpes:// to specified folder? I’m using the script below.
import fmeobjects
import os
from ftplib import FTP_TLS
import ssl
def processFeature(feature):
path = '/lsms/'
filename = 'apples.zip'
ftp = FTP_TLS('FTP-SERVER')
ftp.ssl_version = ssl.PROTOCOL_TLS
ftp.login('name', 'pass')
ftp.prot_p()
ftp.cwd(path)
ftp.retrbinary("RETR " + filename, open(filename, 'wb').write)
ftp.quit()
feature.setAttribute('name', filename)