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 ...
随机推荐
- git 出错 bad index file sha1 signature
error: bad index file sha1 signature fatal: index file corrupt 解决方法:使用git命令执行: $ rm -f .git/index $ ...
- Js参数值中含有单引号或双引号解决办法
<script type="text/javascript"> function Display(LoginEmail, UserName, ID) { ...
- 给zTree添加onSelect callback
由于jquery ui没有集成tree控件,所以在网上找到了zTree v3.zTree无疑是功能非常强大的一款jquery的插件,而且是国人作品,zTree的文档写得也非常好,效果很炫.但是我在使用 ...
- 183使用 MediaPlayer Framework 框架播放视频
效果如下: ViewController.h #import <UIKit/UIKit.h> #import <MediaPlayer/MediaPlayer.h> @inte ...
- 性能分析Linux服务器CPU利用率
CPU度量 1. 指标范围 1.1 User mode CPU utilization+ System mode CPU utilization 合理值:60-85%,如果在一个多用户系统中us+ ...
- 有关maven不能加载ojdbc14.jar解决方法
首先下载ojdbc14-10.2.0.4.0.jar这个包,然后在cmd下输入以下 mvn install:install-file -DgroupId=com.oracle -DartifactId ...
- 网页CSS常用中英文字体收集
Windows的中文字体: 黑体:SimHei 宋体:SimSun 新宋体:NSimSun 仿宋:FangSong 楷体:KaiTi 仿宋_GB2312:FangSong_GB2312 楷体_GB23 ...
- 【转载】高可用的MongoDB集群详解
1.序言 MongoDB 是一个可扩展的高性能,开源,模式自由,面向文档的数据库. 它使用 C++编写.MongoDB 包含一下特点: l 面向集合的存储:适合存储对象及JSON形式的数据. l ...
- JavaScript实现最简单的拖拽效果
一.一些无关痛痒的唠叨 拖拽还是挺不错的一个页面效果,我个人认为,其生命力在于可以让用户自己做一些操作,所谓自定义.例如: ①浏览器标签顺序的拖拽切换 现在基本上所有的选项卡式的浏览器都有顺序拖拽切换 ...
- phpcms v9模板制作教程(转载)
第一节 1.首先下载phpcms v9的集成安装包并安装,这里就不详细说明了. 2.本地调试建议大家使用APMserver,或者wampserver等,可以到PHPCMS吧官方网站首页链接下载.安装好 ...