Perhaps your problem is latency? Try asleep 5;or so before the size test.
In reply to Re: Problems getting FTP file size by Roy Johnson in thread Problems getting FTP file size by nsyed