1
- """
2
- File transfer protocol used to send and receive files using FTP server.
3
- Use credentials to provide access to the FTP client
1
+ """
2
+ File transfer protocol used to send and receive files using FTP server.
3
+ Use credentials to provide access to the FTP client
4
4
5
- Note: Do not use root username & password for security reasons
6
- Create a seperate user and provide access to a home directory of the user
7
- Use login id and password of the user created
8
- cwd here stands for current working directory
9
- """
5
+ Note: Do not use root username & password for security reasons
6
+ Create a seperate user and provide access to a home directory of the user
7
+ Use login id and password of the user created
8
+ cwd here stands for current working directory
9
+ """
10
10
11
11
from ftplib import FTP
12
12
ftp = FTP ('xxx.xxx.x.x' ) """ Enter the ip address or the domain name here """
13
13
ftp .login (user = 'username' , passwd = 'password' )
14
14
ftp .cwd ('/Enter the directory here/' )
15
15
16
- """
17
- The file which will be received via the FTP server
18
- Enter the location of the file where the file is received
19
- """
16
+ """
17
+ The file which will be received via the FTP server
18
+ Enter the location of the file where the file is received
19
+ """
20
20
21
21
def ReceiveFile ():
22
22
FileName = 'example.txt' """ Enter the location of the file """
@@ -25,12 +25,12 @@ def ReceiveFile():
25
25
ftp .quit ()
26
26
LocalFile .close ()
27
27
28
- """
29
- The file which will be sent via the FTP server
30
- The file send will be send to the current working directory
31
- """
28
+ """
29
+ The file which will be sent via the FTP server
30
+ The file send will be send to the current working directory
31
+ """
32
32
33
33
def SendFile ():
34
34
FileName = 'example.txt' """ Enter the name of the file """
35
35
ftp .storbinary ('STOR ' + FileName , open (FileName , 'rb' ))
36
- ftp .quit ()
36
+ ftp .quit ()
0 commit comments