I am trying to upload a file to FTP. I am trying to upload a file to /public_html
on files.000webhost.com
but I keep getting ftplib.error_perm: 500 Unknown command
My code is below:
import ftplib
session = ftplib.FTP('files.000webhost.com','hazaaay','dwadawdadw')
file = r'C:\\Users\\Downloads\\A csv\\a csv1.csv','b' # file to send
session.storbinary('a csv1.csv', file) # send the file
file.close() # close file and FTP
session.quit()
Despite giving unresolved reference, it says in console that process finished with exit code 0 though it is not showing up in FileZilla. Any ideas? Thanks.
You have to specify the command in the
FTP.storbinary
call.