download - python FTP error when dowloading all files in a list -


does know why python not downloading files in list below? first file downloads , 'error2' second file.

fdnload1 = ['aaa092214.txt', '092214 report totals.txt'] try:     # download files     fdn in fdnload1:         ftrans1 = open(fdn,'wb')         ftp.retrbinary('retr ' + fdn, ftrans1.write)         print 'downloading...' + fdn except:     print 'error2' 

results:

downloading...aaa092214.txt error2 

when run program without downloading files, iterates through files:

try:     # download files     fdn in fdnload1:         print 'downloading...' + fdn except:     print 'error2' 

results:

downloading...aaa092214.txt downloading...092214 report totals.txt [finished in 0.3s] 

e d t # 1: able files in fdnload1 download creating separate function download files, still getting errors, , coming actual download process (see results printing 'error in download1() function'. know why?

also, checked files downloaded , empty, did not download properly...

def download1(fdn):     os.chdir('c:/directory10')     try:         ftrans1 = open(fdn,'wb')         ftp.retrbinary('retr ' + fdn, ftrans1.write)         print 'file: ' + fdn + 'download complete...'     except:         print 'error in download1() function' 

modified original code run download() function:

try:     # download files     fdn in fdnload1:         print 'downloading... ' + fdn         download1(fdn) except:     print 'error2' 

results:

downloading... aaa092214.txt error in download1() function downloading... 092214 report totals.txt error in download1() function 

it user permissions error on ftp side.

ftplib.error_perm: 550 aasn092214.pci: permission denied.

logged in under superuser , able download files , without download1() function...

thanks


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -