I put the same file on different ftp. But the size does not match. And I tried to fill it up even in ASCII mode, even binary. Accordingly, the question is - how can you find out the actual file size by ftp protocol?

  • one
    There are many options. From simply trite mode, it was not possible to set up the file and the file was not downloaded to the end until the tricky settings of the FTP and crazy firewalls / antiviruses. At least the size of the files led. Have you tried to download the file back and compare? - KoVadim
  • And how do these dimensions relate to reality? - D-side
  • The file is whole and working. No problem with him. I upload it to many servers. And almost always it weighs 13179 bytes. But I got one server on which the file weighs 13,477 bytes. I tried to change the transmission mode - all the same. And if you upload a file through the file manager to this host, then the size is 13179 as it should. Namely, if via the ftp protocol, then 13477. - Cker

1 answer 1

File size should be the same everywhere, as it depends on the content. There is the size of the file contents in bytes, and there is the size that the file occupies on the disk. The second size depends on how many clusters on the disk it occupies. Because if the file size is 524 bytes, then it occupies 1024 bytes on the disk, if the cluster size is 512 and 2048 bytes, if it is 2048. This size can vary, the first is not. The bytes should be the same everywhere and the checksum should be the same.

Try installing a free FTP server or demo with a time limit on your computer. You can a couple of. The FTP server takes the files that are on the disk, in a local folder, so you can share it in the settings and put the file there. Download it, then compare size and checksum. Upload this file back to your FTP server in another folder. Compare two local files.

You can also use file managers, such as FAR, to view FTP content. There is a plugin (even in my opinion, it enters the standard installation) by Alt + F1 (F2) is called.
That is the point is that the FTP server places and delivers real files from a local disk for themselves and their sizes must match up to a byte.

If the file sizes do not match, then the files do not match. So the file is incorrectly downloaded. Or you need to update the folder to re-read the new file size.

  • To analyze the file size, I take the size that the OS gives. To measure each file in bytes is very expensive. With clusters, I understand. Maybe there is a method to find out the actual size of the OS? Now I use ls -la. - Cker
  • I conduct experiments and found out that in this "special" server is simply saved \ n \ r. 5 lines - the file is 5 bytes longer. But why does he do it? I tried to change the connection modes - all the same. - Cker
  • File managers with file sizes help, for example mc commander. I think we need to google just for this server problem, rather the case is in its settings of some kind (config or possibly a bug in the version). There are no miracles in the world. The content should not change during transmission, it means an error in the FTP server. The option that the file was not downloaded, as far as I understood, is completely discarded. If this particular file adds, you need to try other files: just text, size zero, another binary. Then the problem can be more clearly outlined and the pattern will be clarified. - Albert Fomin