我编写了一个脚本,以便可以将大型的压缩数据集发布到FTP站点,但是我不断收到回报,说它超过了8900字节的限制。
是否有解决方法?我要发布的压缩文件超过70,000 KB
我对python编码还很陌生,我不确定是否有办法增加使用此方法可以发布的数据量。
#import ftplib module
import ftplib
#determine file name
filename = "COAUpload.zip"
#input FTP host name in parentheses
ftp = ftplib.FTP('Hostname')
#input login info ("Username" , "Password"). this logs you into the default root directory
ftp.login("Username","Password")
#input file path of desired file to upload (File Path, permissions) r = read, b = buffer (ability to send as a file instead of text)
myfile = open(r'H:\COA_Upload\COAUpload.zip','rb')
#upload file to FTP
ftp.storlines('STOR ' +filename,myfile)
#close connection to FTP
ftp.quit()