import ftplib import os FTP_HOST = "35.202.201.198" FTP_USER = "ftp_client" FTP_PASS = "1234" ftp = ftplib.FTP(FTP_HOST, FTP_USER, FTP_PASS) ftp.encoding = "utf-8" dirFTP = "APIOrganizations" toFTP = os.listdir(dirFTP) for filename in toFTP: print(filename) with open(os.path.join(dirFTP,filename), 'rb') as file: #Here I open the file using it's full path ftp.storbinary(f'STOR {filename}', file) #Here I store the file in the FTP using only it's name as I intended ftp.quit()