一. windows10 下搭建ftp环境
1.控制面板–》程序–》启用或关闭Windows功能–》Internet Information Service(Internet信息服务)–》选中FTP服务、FTP扩展性、IIS管理控制台
2. IIS --》添加FTP站点
二. FTP文件的上传下载
**1.添加配置文件 ftp.properties**
ftp.username=ftp
ftp.password=
ftp.path=sxadc
ftp.server=192.168.90.132
ftp.port=21
ftp.type=0
2.加载配置文件信息
private static String USERNAME = null;
private static String PASSWORD = null;
private static String PATH = null;
private static String SERVER = null;
private static int PORT = 0;
private static String TYPE = null;
static {
Properties property = new Properties();
try {
property.load(UploadFile.class.getResourceAsStream("/config/ftp.properties"));
USERNAME = property.getProperty("ftp.username");
PASSWORD = property.getProperty("ftp.password");
PATH = property.getProperty("ftp.path");
SERVER = property.getProperty("ftp.server");
PORT = Integer.parseInt(property.getProperty("ftp.port"));
TYPE = property.getProperty("ftp.type");
} catch (Exception e) {
e.printStackTrace();
}