optimize ftp file extension and basename recognition