Windows, Linux upload and download from FTP server via FTP

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.