Why does the size of a file change after the file is uploaded to a device through FTP

1

The FTP protocol supports two file transfer modes: ASCII and binary. The ASCII mode is used to transfer text files, and the binary mode is used to transfer compressed files, databases, system software, and other program files. When the ASCII mode is used, some content is automatically converted during file transfer. Therefore, the file size changes after it is uploaded to the device.

Other related questions:
Why does the size of a file change after the file is uploaded through FTP
There are two FTP transmission modes: binary transmission and text transmission. If the text transmission mode is used, certain content is automatically converted after FTP transmission. Therefore, it is advised to use the binary transmission mode to transfer a binary file, such as the system software file.

Why does the size of a file change after the file is uploaded through FTP on to an S series switch
For S series switches (except S1700 switches), the FTP protocol supports two file transfer formats: binary and ASCII. The ASCII format is used to transfer text files, and the binary format is used to transfer compressed files, databases, system software, and other program files. When the ASCII format is used, some content of files is automatically converted during file transfer. Therefore, the file size changes after it is uploaded to switches.

Uploading files through FTP on the USG6000
The configuration roadmap for FTP file upload is as follows: The device serves as the FTP server, and no independent software shall be installed. Configuration on the device is required. Note: When you upload a file to the device from the configuration terminal, and the device has a file with the same name, no information is prompted, and the original file is directly overwritten. To save the original file, run the rename command to change the file name before file upload. 1. Enable FTP and configure the FTP user name, password, and FTP path. system-view [sysname] ftp server enable Info: Start FTP server [sysname] aaa [sysname-aaa] manager-user ftpuser [sysname-aaa-manager-user-ftpuser] password Enter Password: Confirm Password: [sysname-aaa-manager-user-ftpuser] service-type ftp [sysname-aaa-manager-user-ftpuser] level 3 [sysname-aaa-manager-user-ftpuser] ftp-directory hda1:/ Note: The password configured on the device must meet the password strength requirements. It is recommended that the password contain at least three types of such characters as case-sensitive letters, digits, and special characters. Local users for FTP need to run the ftp-directory command to configure the FTP path to save the file on the device. 2. Run the ftp command to log in to the device from the configuration terminal. Run the put command to upload the file to the device. This part uses a Windows PC as an example: Choose Start > Run, enter cmd, and click OK. C:\Documents and Settings\Administrator> ftp 192.168.0.1 User (192.168.0.1:(none)): ftpuser Password: 230 User logged in. ftp>put vrpcfg.cfg /Upload the file to the device. ftp> lcd /You can display the file upload path. Local directory now C:\Documents and Settings\Administrator. ftp> Note: Administrator is the default OS user name. You can set different user names. You can run the lcd command to query the storage path for the backup configuration file. Commands on different FTP clients may differ due to different OSs. For details, refer to related OS documents.

Uploading files through FTP on the USG2000&5000
The configuration roadmap for FTP file upload is as follows: 1. Configuration roadmap a. Enable the FTP server function of the device and configure valid login users. b. Log in to the device through HyperTerminal on the PC. c. Log in to the FTP server using the correct user name and password. d. Upload the file to the device. 2. Operation steps a. Enable FTP on the FTP server and configure the authorization information of FTP users. system-view [Firewall] ftp server enable [Firewall] aaa [Firewall-aaa] local-user admin password irreversible-cipher Admin@123 b. Configure the authorization mode, priority, and directory of the FTP users on the FTP server. [Firewall-aaa] local-user admin service-type ftp [Firewall-aaa] local-user admin level 3 [Firewall-aaa] local-user admin ftp-directory flash: [Firewall-aaa] quit c. Set the IP address of the FTP server. [Firewall] interface GigabitEthernet 0/0/1 [Firewall-GigabitEthernet0/0/1] ip address 128.18.90.111 255.255.255.0 [Firewall-GigabitEthernet0/0/1] quit 3. Configuration verification Upload the file to the device for authentication. C:\Documents and Settings\user> ftp 128.18.90.111 User(128.18.90.111:(none)): admin Password: 230 User logged in. ftp> binary ftp> put sys.bin ftp> quit Display the obtained file on the device. dir 10:28:14 2015/04/23 Directory of flash:/ 0 -rw- 43046824 Aug 19 2014 16:39:41 sys.bin 1 -rw- 0 Aug 19 2014 17:02:39 patchnpstate.dat 2 -rw- 37 Apr 10 2015 08:42:15 private-data.txt 3 -rw- 4648 Apr 07 2015 10:48:53 vrpcfg.zip 4 -rw- 7526 Dec 12 2014 16:39:09 vrpcfg11.cfg 5 -rw- 512 Jan 28 2015 10:50:26 runmode.ini 57277 KB total (15220 KB free)

If you have more questions, you can seek help from following ways:
To iKnow To Live Chat
Scroll to top