上传文件需要multipart/form-data
同时参数也需要使用[FromForm]修饰

        [HttpPost]
[Consumes("application/json", "multipart/form-data")]
[DisableRequestSizeLimit]
[AllowAnonymous]
public void Upload([FromForm] TestInDto testDto)
{
var files = HttpContext.Request.Form.Files;
foreach (var file in files)
{
}
}

​参考​

留待后查,同时方便他人