Answer the question
In order to leave comments, you need to log in
Trouble uploading data to FTP Python?
Upload files to FTP with this script
import ftplib
host = "XXXX"
ftp_user = "XXXX"
ftp_password = "XXXX"
filename = "txt.txt"
FTP_TIMEOUT = 10
con = ftplib.FTP(host, ftp_user, ftp_password, FTP_TIMEOUT)
con.set_pasv("true")
f = open(filename, "rb")
con.cwd('htdocs')
con.storbinary("STOR "+ filename, f)
con.close()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question