FtpWebRequest UploadFile返回"The underlying connection was closed: The server committed a protocol violation."解决方法
将FtpWebRequest的KeepAlive设置为true。
return Return<Boolean>(
new Uri(ftpPath + fileName),
request =>
{
request.Credentials = credentials;
request.Method = WebRequestMethods.Ftp.UploadFile;
request.KeepAlive = true;
request.UseBinary = true; using (var requestStream = request.GetRequestStream())
{
var bufferSize = ;
var read = ;
var buffer = new Byte[bufferSize]; while ((read = stream.Read(buffer, , bufferSize)) > )
requestStream.Write(buffer, , read);
}
},
respone => true);
FtpWebRequest UploadFile返回"The underlying connection was closed: The server committed a protocol violation."解决方法的更多相关文章
- [WebException: The underlying connection was closed: The message length limit was exceeded.]解决方法
[WebException: The underlying connection was closed: The message length limit was exceeded.] Syste ...
- windows xp .net framework 4.0 HttpWebRequest 报The underlying connection was closed,基础连接已关闭
windows xp .net framework 4.0 HttpWebRequest 报The underlying connection was closed,基础连接已关闭,错误的解决方法 在 ...
- C#使用FtpWebRequest 基础连接已经关闭:连接被意外关闭(The underlying connection was closed:The connection was closed unexpectedly)
公司内部开发的winform程序使用了FtpWebRequest下载FTP服务器的文件到本地. 大多数人运行良好,由于我们是试运行逐步有人加入到平台的使用,前两天突然有个别机器无法连接FTP服务器报出 ...
- EX:The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
EX:The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secu ...
- Web Server 使用WebClient 发送https请求 The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel
使用WebClient 发送https请求 使用WebClient发送请求时,并且是以https协议: WebClient webClient = new WebClient(); string re ...
- 微信接口问题(The underlying connection was closed: An unexpected error occurred on a send)
突然在调用微信接口是报:The underlying connection was closed: An unexpected error occurred on a send错误,跟踪了半天,是因为 ...
- [bug]The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
写在前面 在模拟请求的时候,如果url为https的,会报这个错误.大概错误就是:基础连接已关闭:无法建立信任关系的SSL / TLS的安全通道. The underlying connection ...
- The underlying connection was closed: An unexpected error occurred on a send
操作系统是Windows Server 2003 x64 SP2,使用Framework 4.0,在使用WebClient访问某些特定的HTTPS站点时,会引发异常: Unhandled Except ...
- ORACLE用SYS登录报ORA-28009:connection as SYS should be as SYSDBA OR SYSOPER解决方法
情况一:使用sqlplus登录 正常输入用户名的口令,就会报错,因为SYS是在数据库之外的超级管理员,所以我们在登录的时候 要在输入口令:口令+as sysdba(比如:123456 as sysdb ...
随机推荐
- 基于redis集群实现的分布式锁,可用于秒杀,定时器。
在分布式系统中,经常会出现需要竞争同一资源的情况,使用redis可以实现分布式锁. 前提:redis集群已经整合项目,并且可以直接注入JedisCluster使用: @Autowired privat ...
- 'AndroidManifest.xml' must have a minimum of 2 segments.
Manifest下必须有二级域名 <manifest xmlns:android="http://schemas.android.com/apk/res/android" p ...
- 【Web API系列教程】3.3 — 实战:处理数据(建立数据库)
前言 在本部分中,你将在EF上使用Code First Migration来用測试数据建立数据库. 在Tools文件夹下选择Library Package Manager,然后选择Package Ma ...
- 基于原生PHP交叉会员权限控制
对于一个网站的后台管理系统,单一的超级管理员权限往往不能满足我们的需求,尤其是对于大型网站而言,这种单一的权限会引发许许多多的问题出现. 比如:一个网站编辑,平时他只是负责公司网站的公告更新,但如果网 ...
- nginx隐藏server信息和版本信息
1.隐藏版本信息 在nginx.conf里面添加 server_tokens off; 2.隐藏server信息 需要重新编译ngnix进入解压出来的nginx 源码目录 vi src/http/ng ...
- Two FIFOs of length 253 with 8-bits
FIFO 先入先出队列(First Input First Output,FIFO) 可以实现数据缓存. 一.FIFO的一些重要参数: 1.length:未知,待查 //补充:学长说:“FIFO一般只 ...
- war内部结构
war index.html(非必须) WEB-INF classes (java编译之后的class文件) lib(jar文件) web.xml(war包描述文件) subdirectories[可 ...
- Java泛型方法与数据查询
在使用JDBC查询数据库中数据时,返回的结果是ResultSet对象,使用十分不方便.Commons DbUtils组件提供了将ResultSet转化为Bean列表的方法,但是该方法在使用时需要根据不 ...
- SpringMVC由浅入深day01_1springmvc框架介绍
springmvc 第一天 springmvc的基础知识 课程安排: 第一天:springmvc的基础知识 什么是springmvc? springmvc框架原理(掌握) 前端控制器.处理器映射器.处 ...
- IIS6独立用户建立网站的方法,提高网站安全性
在Windows server 2003系统下,用IIS架设Web服务器,合理的为每个站点配置独立的Internet来宾账号,这样可以限制Internet 来宾账号的访问权限,只允许其可以读取和执行运 ...