Found bug in Digi FTP library. FTP file sending always sent 2048 bytes, when file was shorter. It seems the problem was, that it was sending as many bytes as was allowed by the socket. rc = sock_writable(…) later on (in ftp_client_tick function) there is a call to sock_fastwrite(…) in which the length parameter is this rc, which is the maximum amount of bytes,that can be transmitted. This is the mentioned 2048, which is incorrect. It should be the length of the file: ftp.length. When changed like this it started to send the right amount of bytes to FTP server. Changed this temporarily to FTP_CLIENT.LIB file and worked fine.
I would appreciate if somebody would confirm, this is a known problem or if there is something else going on (misunderstanding etc.).