Notice
Recent Posts
Recent Comments
Link
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- flutter
- 유니티
- Linux
- port
- ASP
- IOS
- MySQL
- swift
- node.js
- 라즈베리파이
- 맛집
- Unity
- 리눅스
- javascript
- 다이어트
- 함수
- tensorflow
- sqlite
- PyQt
- GIT
- pandas
- PER
- 날짜
- urllib
- python
- PyQt5
- ubuntu
- MS-SQL
- Excel
- mssql
Archives
아미(아름다운미소)
[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