| 1 |
ninoborges |
8 |
"""
|
| 2 |
|
|
|
| 3 |
|
|
FTP testing
|
| 4 |
|
|
|
| 5 |
|
|
"""
|
| 6 |
|
|
|
| 7 |
|
|
from ftplib import FTP
|
| 8 |
|
|
|
| 9 |
|
|
|
| 10 |
|
|
connection = FTP('sftp.bostonlit.com')
|
| 11 |
|
|
connection.login('Eborges','!Concordanc3')
|
| 12 |
|
|
#connection.dir()
|
| 13 |
|
|
connection.cwd("test")
|
| 14 |
|
|
#test = open(r"C:\Test_dir\41248700.tar",'rb')
|
| 15 |
|
|
## ALWAYS make sure to open these files in rb, binary mode. If not it will only copy half.
|
| 16 |
|
|
test = open(r"\\ercdis12\admin\share\Manny\wip\Prod.rar",'rb')
|
| 17 |
|
|
connection.storbinary("STOR prod.rar",test)
|
| 18 |
|
|
|
| 19 |
|
|
test.close()
|
| 20 |
|
|
connection.close()
|