当前位置:网站首页>Ubuntu20.04 access FTP server garbled problem + upload files

Ubuntu20.04 access FTP server garbled problem + upload files

2020-11-08 11:42:22 Xlgd

stay Ubuntu Next visit to the school FTP Server time , Chinese folder display garbled code . This is due to the different coding ,Ubuntu In general use UTF-8, And the school server should be GBK, And now Firefox It's not supported FTP agreement , Unable to transfer file on Browser , So you can choose to operate under the terminal .

  1. install lftp command
sudo apt-get install lftp
  1. Connect to server , among username It's your user name on the server ,,password It's your code ,address It's the server address . Before connecting to the server , First, please cd Go to the directory where you want to upload files
lftp ftp://<username>:<password>@<address>
  1. After successful connection , Continue to enter the following command to set the encoding
set ftp:charset gbk
set file:charset utf8
  1. Generally speaking, the Chinese name can be displayed normally now . If the file cannot be processed cd or ls operation , Then continue to enter the following command to set
set ssl:verify-certificate no
  1. After you can access the folder normally , Use put Order to upload your files . here put You can upload files directly from your local directory
put yourfile

Reference resources

版权声明
本文为[Xlgd]所创,转载请带上原文链接,感谢