鉴于您必须将所有字节加载到内存中才能将其转换为 Base64 字符串,请考虑增加
maxAllowedSize
await resizedImageFile.OpenReadStream(maxAllowedSize: 1000000).ReadAsync(imageBytes);