Recently I was working on a project and wanted to upload a file on FTP using Python. import ftplib from ftplib import FTP File2Send = ‘file path’ #To upload file in root directory of FTP location Output_Directory = “” ftp = FTP(“ftp.ourpcgeek.com”) ftp.login(‘user’,’password’) file = open(File2Send, “rb”) ftp.cwd(Output_Directory) ftp.storbinary(‘STOR ‘ + File2Send, file) print (“STORing… (0 comment)