If you test @ftp_size() with various servers, you will get wrong result due to the fact that these servers are in "ascii mode" by default.
I did not find any solution to force the ftp type to binary before asking ftp_size(), and therefore I only see the following hack:
.. open the ftp connection
@ftp_get($fd,"/dev/null","DUMMY_FILE_FOR_TYPE_I",FTP_BINARY); / HACK to force ftp server in type I /
$size=ftp_size($fp,"myfile");
Any cleaner solutions?