Windows FTP uses

Source: Internet
Author: User
Tags i18n locale

1. Download Address: http://mina.apache.org/ftpserver-project/download_1.0.6.html

2. Extract to D:/ftp

3. Modify D:/ftp/res/conf/ftpd-typical.xml default port is 2121, set password is not encrypted


4. Modify D:/ftp/res/conf/users.properties


5. Start Ftpd.bat D:/ftp/res/conf/ftpd-typical.xml

6. Input ftp://localhost:2121/test, file storage location D:\ftp\res\home

7.java Test (found some computer abnormal, please turn off the firewall)

Package test;    
Import Java.io.File;    
Import Java.io.FileInputStream;    
Import org.apache.commons.net.ftp.FTPClient;    
    
Import org.apache.commons.net.ftp.FTPReply;      
    public class Ftptest {private ftpclient ftp; /** * * @param path uploaded to the FTP server @param addr Address * @param port port number * @param user Name username * @param password Password * @return * @throws Exception/Private Boolean Connec T (String path,string addr,int port,string username,string password) throws Exception {Boolean result = Fals      
        E      
        FTP = new FtpClient ();      
        int reply;      
        Ftp.connect (Addr,port);      
        Ftp.login (Username,password);      
        Ftp.setfiletype (Ftpclient.binary_file_type);      
        Reply = Ftp.getreplycode (); if (!      
            Ftpreply.ispositivecompletion (Reply)) {ftp.disconnect ();      return result;
        } ftp.changeworkingdirectory (path);      
        result = true;      
    return result; /** * * @param files or folders uploaded by file * @throws Exception/private void upload ( File file) throws exception{if (File.isdirectory ()) {ftp.makedirectory (File.getname ()                
            );      
            Ftp.changeworkingdirectory (File.getname ());             
            string[] files = file.list ();      
                for (int i = 0; i < files.length i++) {file File1 = new File (File.getpath () + "\" +files[i));      
                    if (File1.isdirectory ()) {upload (file1);      
                Ftp.changetoparentdirectory ();      
                    }else{file File2 = new file (File.getpath () + "\" +files[i));      
          FileInputStream input = new FileInputStream (file2);          Ftp.storefile (File2.getname (), input);                            
                Input.close ();      
            }}else{File File2 = new file (File.getpath ());      
            FileInputStream input = new FileInputStream (file2);      
            Ftp.storefile (File2.getname (), input);        
        Input.close ();    
      } public static void Main (string[] args) throws exception{ftptest t = new ftptest ();    
      T.connect ("", "localhost", 2121, "admin", "admin");    
      File File = new file ("D:\\apache-jmeter-2.13.zip");    
   T.upload (file);     }    
}


1. Connecting to an FTP server

Format: FTP [hostname| ip-address]
A) on the Linux command line, enter: FTP 192.168.1.1

b The server asks you username and password, enter the username and the corresponding password respectively, wait for authentication to pass.

2. Download the file

The download file usually uses the get and mget two commands.
a) Get
Format: Get [Remote-file] [Local-file]
Transfers files from the remote host to the local host.
To get/usr/your/1.htm on a remote server, ftp> get/usr/your/1.htm 1.htm (carriage return)


b) mget
Format: mget [Remote-files]
Receives a batch of files from the remote host to the local host.
To get all the files under/usr/your/on the server, ftp> cd/usr/your/
ftp> mget *.* (carriage return)


Every time you download a file, you will be prompted. If you want to remove the hint, execute before mget the *.* command: Prompt off

Note: The files are downloaded to the Linux host's current directory. For example, the FTP command that runs under/usr/my, the files are downloaded to the/usr/my.

3. Upload file

a) put
Format: Put Local-file [Remote-file]
Transfers a local file to the remote host.
If you want to transfer the local 1.htm to the remote host/usr/your, and renamed to 2.htm ftp> put 1.htm/usr/your/2.htm (enter)


b) mput
Format: Mput local-files
Transfers a batch of files from a local host to a remote host.
To upload all HTML files in the local current directory to the server/usr/your/down ftp> cd/usr/your (enter)
ftp> mput *.htm (carriage return)


Note: The upload files are from the host's current directory. For example, the FTP command that runs under the/usr/my, only the file Linux under/usr/my will be uploaded to the server/usr/your.

4. Disconnect the connection
Bye: Interrupts the connection to the server. Ftp> Bye (carriage return)

Yum, no orders.
#yum install-y FTP

System environment: Red Hat Enterprise Linux Server 6

[root@1-min huage]# locale//View the locale of the current system

Lang=en_us. UTF-8

Lc_ctype= "en_US. UTF-8 "

Lc_numeric= "en_US. UTF-8 "

.....

[Root@1-min huage]# locale-a//View all languages supported by the system

。。。。 Here omitted the

en_US

en_us.iso88591

en_us.iso885915

En_us.utf8

。。。。。

Zh_cn

zh_cn.gb18030

zh_cn.gb2312

Zh_cn.gbk

Zh_cn.utf8

。。。。

[Root@1-min huage]# source/etc/sysconfig/i18n

Reload the i18n file without rebooting

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.