Recently need to use the file upload and download, view the system we used, found that there is a process for t_ftpd, suspected that it is an FTP daemon, and then want to be implemented in the FTP way.
Implemented using the Bat script on Windows:
First write a bat script:
Download.bat
-s:e:\sylixos\sylixos_qt\build-tcwarewigget-desktop_qt_5_7_1_mingw_32bit-debug\debug\ftp\ftp.txt
This will call the Ftp.txt file
Ftp.txt
10.1. 26.11 Rootroot
Asciiprompt offlcd E:\Sylixos\SylixOS_Qt\build-tcwarewigget-desktop_qt_5_7_1_mingw_32bit-/apps/ Goahead Get Auth.txtclosebyequit
This enables the file to be downloaded.
Here is a detailed explanation
@echo off Turn off Echo
ftp-s:$PATH FTP command
10.1.26.11 Setting up a specified FTP server connection to specify a connection port
Sets the file transfer mode to binary, which defaults to ASCII. Binary mode does not do any processing of the data, and ASCII mode wraps the carriage return.
Converts the carriage return character to native. About binary and ASCII transmission modes
Download prompt On upload
LCD local-dir: Switch the local working directory to Local-dir (note the difference between the Windows path and the Linux path)
CD Remote-dir: Enter the remote host directory Remote-dir
Mget *.gz Bulk Download gz end file mput *.gz Bulk upload gz End file I here batch test always failed, for some reason, finally select a single file download upload
Close interrupts the FTP session with the remote server
Bye exiting the FTP session
Quit quitting
Similarly, get a shell script under Linux:
#!/bin/-niv <<-10.1. 26.11 /apps/goaheadlcd. /prompt offget auth.txtclosebyeeof
At this point, through Windows scripting, Linux scripts upload and download files from the FTP server to complete, passing the test.
Windows, Linux upload and download from FTP server via FTP