#import libraries
import os
import pysftp
# query for file to ftp
alr_file = '/Users/path/to/file/to_ftp'
ftpALR = []
def findFile():
for item in os.listdir(alr_file):
if item.endswith('.mdb'):
ftpALR.append(alr_file + '/' + item)
# ftp transmission function
def ftpTransmit():
# list ftp dir
cnopts = pysftp.CnOpts()
cnopts.hostkeys = None
with pysftp.Connection(host='ftp.acme.com',
username='cloudUser',
password='NOT_A_REAL_PWD',
port=22,
cnopts=cnopts) as sftp:
length = len(ftpALR)
for i in range(length):
sftp.put(ftpALR[i])
findFile()
ftpTransmit()
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE