LPS-45067 Avoid inputStream lost bytes when add page attachment