Notice
Recent Posts
Recent Comments
Link
아미(아름다운미소)
[ftplib] python ftp file upload 본문
[ftplib] python ftp file upload
import ftplib filename = "sample.png" ftp = ftplib.FTP() ftp.connect("111.111.111.111","21") #Ftp 주소 Connect(주소 , 포트) ftp.login("id", "password") #login (ID, Password) ftp.cwd("/forder/Test") #파일 전송할 Ftp 주소 (받을 주소) os.chdir(r"D:\\FTP_TEST\\img") #파일 전송 대상의 주소(보내는 주소) my_file = open(filename, 'rb') #Open( ~ ,'r') <= Text파일은 됨, Open( ~ ,'rb') <= 이미지파일 됨 ftp.storbinary('STOR ' + filename, my_file) my_file.close() ftp.close()
'랭귀지 > python' 카테고리의 다른 글
python 에서 한글폴더 읽기 (0) | 2018.08.13 |
---|---|
Python: Download from FTP server using ftplib (0) | 2018.08.11 |
pymssql CRUD 예제 (0) | 2018.08.09 |
이미지 파일 확인하기 (0) | 2018.06.07 |
JPEG 섬네일 생성하기 (0) | 2018.06.04 |
Comments