i try to upload file via ftp in cpanel but the server refused connection and i used FTP_TLS it seems connected but i don't know how to upload file in this case
this is my connection code in FTP_TLS
:
from ftplib import FTP_TLS
ftp=FTP_TLS()
ftp.set_debuglevel(2)
ftp.connect('ftp.EX.com')
ftp.sendcmd('ftp_usr')
ftp.sendcmd('ftp_pass')
ftp.dir()
ftp.close()
and the result is this following note:
*get* '220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------\n'
*get* '220-You are user number 2 of 50 allowed.\n'
*get* '220-Local time is now 00:08. Server port: 21.\n'
*get* '220-This is a private system - No anonymous login\n'
*get* '220-IPv6 connections are also welcome on this server.\n'
*get* '220 You will be disconnected after 15 minutes of inactivity.\n'
*resp* '220---------- Welcome to Pure-FTPd [privsep] [TLS] ----------\n220-You are user number 2 of 50 allowed.\n220-Local time is now 00:08. Server port: 21.\n220-This is a private system - No anonymous login\n220-IPv6 connections are also welcome on this server.\n220 You will be disconnected after 15 minutes of inactivity.'
*cmd* 'ftp_usr'
*put* 'ftp_usr\r\n'
and i try this to upload example file like this but the result is same as previous note and nothing changed :
ftp=FTP_TLS()
ftp.set_debuglevel(2)
ftp.connect('ftp.EX.com')
ftp.sendcmd('ftp_usr')
ftp.sendcmd('ftp_pass')
file = open('imaege.jpg','rb')
ftp.storbinary('STOR image.jpg', file)
ftp.dir()
ftp.close()