Topic "How to avoid file size changes?"

Author Message
[View user's profile]

Joined: 2010-06-20
Posts: 2

How could I prevent that files I upload to the web server to be resized? For example when update the index.html file changes its size from 66.219 to 65.409 bytes on the web server.

Why is that and how I can I avoid this?

The thing about this is that the folders never seem to be synchronized by the difference in file sizes.

WinSCP is really very good, but some things I still do not understand.

Thanks again for any help.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
Force binary transfer mode.
Martin Prikryl

ajd wrote:
Why is that...

...that type of difference in size is because of line ending conversion. You likely have Windows on your computer & are connecting to a Linux server. Windows's default line ending is CR+LF (carrage return, line feed), Linux is LF...(Mac is CR, if anyone cares) that's why the file size changes, WinSCP is converting the line endings for the target system. So that means there were 810 line endings in index.html when you transferred it!

ajd wrote:
...and how I can I avoid this?

...well, as he said, you can force binary transfer mode, which will stop converting line endings...but you might wanna just leave it as is, cuz it's already "doing the right thing". It wouldn't hurt to transfer a few files binary & make sure they still work on the other side (index.html & simple files like that should be fine). Linux can probably handle Windows line endings, it just doesn't want too (in some cases). I kinda like the smaller files on Linux, saves web-host space! The other solution is to use Notepad2 & create files with Linux line endings, even on Windows, then they are smaller all the time.

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License