Are you using
binmode() at all? That may be part of the problem.
Update: Did you try using Debug as
derby suggested? If so, what were the errors? Also, there is a note that mentions if you use ASCII transfers -
NOTE: The size reported is the size of the stored file on the remote server. If the file is subsequently transfered from the server in ASCII mode and the remote server and local machine have different ideas about ``End Of Line'' then the size of file on the local machine after transfer may be different. I'm not sure if that would affect it or not.