您好,我有服务器网络API
代码服务器端是
[HttpPost("Recognition")]
public async Task<IActionResult> Recognition(IFormFile file)
{
if(file != null)
{
using (var ms = new MemoryStream())
{
file.CopyTo(ms);
var fileBytes = ms.ToArray();
var toImage = file.OpenReadStream();
Image images = new Bitmap(toImage);
string name = faceHandle.FindAndRecognize(images);
}
我正在尝试将IFormFile转换为Image,连接System.Drawing;
ms有两个错误,它的'ms.ReadTimeout'引发了'System.InvalidOperationException'类型的异常。和|| “ ms.WriteTimeout”引发了类型为“ System.InvalidOperationException”的异常