Showing posts with label Upload or send file to ftp server in python. Show all posts
Showing posts with label Upload or send file to ftp server in python. Show all posts

Wednesday, 1 October 2014

Upload or send file to ftp server in python

you can send or upload any file to ftp server very easy using python. In below code i have used ftplib module for sending files.

use below code and run it.


import ftplib
def send_File(file, user, pwd):
    ftp = ftplib.FTP("ftp.example.com")
    ftp.login(user, pwd)
    ftp.storlines("STOR " + file, open(file))
send_File("users.txt","username","password")

Thank you guys for your support.