Answers for "connect to ftp python"

3

python ftp upload file

import ftplib
session = ftplib.FTP('server.address.com','USERNAME','PASSWORD')
file = open('kitten.jpg','rb')                  # file to send
session.storbinary('STOR kitten.jpg', file)     # send the file
file.close()                                    # close file and FTP
session.quit()
Posted by: Guest on January-09-2021
0

python ftp login

from ftplib import FTP

ftpObject = FTP();

connectResponses = ftpObject.connect(host="ftp.exampleserver.com");
print("Connection Responses\n");
print(connectResponses);
print("\n\n");

loginResponse = ftpObject.login(user="username", passwd="password");
print("Login Response - " + loginResponse + "\n\n");
Posted by: Guest on October-13-2021

Python Answers by Framework

Browse Popular Code Answers by Language