用户登录
用户注册

分享至

python通过pysftp加密上传、下载ftp服务器文件

  • 作者: 晟钧32539545
  • 来源: 51数据库
  • 2022-08-12

python通过pysftp加密上传、下载ftp服务器文件

import pysftp
import sys
  
# Defines the name of the file for download / upload
remote_file = sys.argv[1]
  
srv = pysftp.Connection(host="your_FTP_server", username="your_username",
password="your_password")
  
# Download the file from the remote server
srv.get(remote_file)
  
# To upload the file, simple replace get with put.
srv.put(remote_file)
  
# Closes the connection
srv.close()

软件
前端设计
程序设计
Java相关