.netCore Form 上传文件 IOException: Unexpected end of Stream, the content may have already been read by

news/2024/5/19 22:25:43 标签: .netcore, microsoft, bug

.netCore FormData 上传文件时前端报错,信息如下:
IOException: Unexpected end of Stream, the content may have already been read by another component

解决方案:
经查原来是Controller继承了一个自定义的BaseController,去掉继承,改成继默认的ControllerBase即可


http://www.niftyadmin.cn/n/1418240.html

相关文章

netcore路由InvalidOperationException: Action‘‘doesnothaveanattribute route. ActionMethodsOnController

InvalidOperationException: Action ‘TemplateNetCore.Controllers.CommonController.CommonExcuteReflectionMethod (TemplateNetCore)’ does not have an attribute route. Action methods on controllers annotated with ApiControllerAttribute must be attribute routed…

Identity server4 静态配置 登录

一、服务端代码 1、静态资源代码 public class InitConfig{/// <summary>/// 定义ApiResource/// </summary>/// <returns></returns>public static IEnumerable<ApiResource> GetApiResources(){return new[]{new ApiResource("UserApi&q…

Docker- rabbitMQ 容器安装

1、进入docker hub镜像仓库地址&#xff1a;https://hub.docker.com/ 2、搜索rabbitMq&#xff0c;进入官方的镜像&#xff0c;可以看到以下几种类型的镜像&#xff1b;我们选择带有“mangement”的版本&#xff08;安装后可以通过web打开管理页面&#xff09;&#xff1b; 3、…

rabbitMQ clientApi netcore

一、RabbitMQ几个对象介绍 通过web管理界面截图可以看到&#xff1a;Connections、Channels、Exchanges、Queues、Admin 1、Connections&#xff1a;连接RabbitMQ客户端 2、Channels &#xff1a;通道&#xff0c;相当一个数据库的DB实例 3、Exchanges&#xff1a;消息中枢&am…

Linux、docker、git 常用命令

一、Linux 1、systemctl 系统命令 启动系统进程systemctl start docker 启动docker服务systemctl enable docker 开机自动启动1、开启防火墙 systemctl start firewalld2、开放指定端口firewall-cmd --zonepublic --add-port1935/tcp --permanent命令含义&#xff1a;--zone #…

C# 反射 静态类 静态方法 static

C# 通过反射调用实例类或静态类的方法 一、创建类 //反射对象类 //ruleAssembly为dell文件、ruleNmspaceName &#xff1a;命名空间&#xff1b;ruleClsName&#xff1a;类名 //如果是泛型&#xff0c;ruleClsName后面需要增加一个“1” Type ruleType Assembly.Load(ruleA…

JS problem of float about calculation 小数运算精度问题解决方案

JS在有小数存在的加减乘除运算中&#xff0c;会出先精度问题 解决办法是将小数变为整数&#xff08;乘一个整数&#xff09;&#xff0c;然后再去运算&#xff0c;最后再除相同的整数 例子&#xff1a;1.11 * 2.331 (1.1 * 10) * (2.331 * 1000) / 10 / 1000 完整的方法 numCa…