如果需要开发FTP文件上传下载功能,那么需要在本机上搭建一个本地FTP服务器,方便调试。
https://www.cnblogs.com/popfisher/p/7992036.html
CMD 连接ftp服务器下载文件
https://jingyan.baidu.com/article/2a138328ceef65074a134ff1.html
服务器:
cmd 尝试连接ftp服务器下载文件
C:\Users\Administrator>ftp
ftp> open 192.168.71.1 21
连接到 192.168.71.1。
220 Microsoft FTP Service
用户(192.168.71.1:(none)): Test
331 Password required for Test.
密码:
230 User logged in.
ftp> dir
200 PORT command successful.
125 Data connection already open; Transfer starting.
08-02-19 08:01AM 87656 DTU_7E3710_D001D.01.bin
08-08-19 07:59AM 88928 DTU_7E3710_D001D.02.bin
08-14-19 10:54AM 89216 DTU_7E3710_D001G.03.bin
08-23-19 09:16AM 89872 DTU_7E3710_D001G.04.bin
08-23-19 04:04PM 89864 DTU_7E3710_D001G.05.bin
09-11-19 08:05AM 90528 DTU_TW_Test.bin
06-24-19 02:01PM 271381 HMI与DTU通讯协议设定_V1_201906.docx
08-23-19 09:45AM 1009 Read me.txt
06-21-19 01:40PM 115747 开通流程.png
226 Transfer complete.
ftp: 收到 557 字节,用时 0.07秒 7.85千字节/秒。
ftp> ls
200 PORT command successful.
125 Data connection already open; Transfer starting.
DTU_7E3710_D001D.01.bin
DTU_7E3710_D001D.02.bin
DTU_7E3710_D001G.03.bin
DTU_7E3710_D001G.04.bin
DTU_7E3710_D001G.05.bin
DTU_TW_Test.bin
HMI与DTU通讯协议设定_V1_201906.docx
Read me.txt
开通流程.png
226 Transfer complete.
ftp: 收到 206 字节,用时 0.01秒 14.71千字节/秒。
ftp> ?
命令可能是缩写的。 命令为:
! delete literal prompt send
? debug ls put status
append dir mdelete pwd trace
ascii disconnect mdir quit type
bell get mget quote user
binary glob mkdir recv verbose
bye hash mls remotehelp
cd help mput rename
close lcd open rmdir
ftp> lcd
目前的本地目录 C:\Users\Administrator。
ftp> lcd E:\
目前的本地目录 E:\。
ftp> get DTU_TW_Test.bin
200 PORT command successful.
125 Data connection already open; Transfer starting.
226 Transfer complete.
ftp: 收到 90528 字节,用时 0.00秒 30176.00千字节/秒。
ftp> close
ftp> bye
C:\Users\Administrator>