Skip to content

Commit c522dda

Browse files
Update ftp_send_receive.py
1 parent d97b34d commit c522dda

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed
+17-17
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
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
44
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+
"""
1010

1111
from ftplib import FTP
1212
ftp = FTP('xxx.xxx.x.x') """ Enter the ip address or the domain name here """
1313
ftp.login(user='username', passwd='password')
1414
ftp.cwd('/Enter the directory here/')
1515

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+
"""
2020

2121
def ReceiveFile():
2222
FileName = 'example.txt' """ Enter the location of the file """
@@ -25,12 +25,12 @@ def ReceiveFile():
2525
ftp.quit()
2626
LocalFile.close()
2727

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+
"""
3232

3333
def SendFile():
3434
FileName = 'example.txt' """ Enter the name of the file """
3535
ftp.storbinary('STOR ' + FileName, open(FileName, 'rb'))
36-
ftp.quit()
36+
ftp.quit()

0 commit comments

Comments
 (0)