自己写的文件下载时候的问题。。。。

y63964632 y63964632 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

if ( Request.QueryString [ "action" ] == "download" )
{

LoadDown = new UpLoadAndGetBinaryFileSoapClient ( );

///得到二进制文件字节数组;

UpFileType type = DownLoadType ( Request.QueryString["type"].ToString());
byte [ ] binaryFile = LoadDown.LoadDownBinaryFile ( 1 , UpFileType.PhotoDesc_ImageFile , out filename );
Response.Buffer = true;
Response.ContentType = "application/octet-stream";
Response.AddHeader ( "Content-Disposition" , "attachment;filename=" + filename );
FileStream fs = new FileStream ( filename , FileMode.OpenOrCreate );
BinaryWriter bw = new BinaryWriter ( fs );
bw.Write ( binaryFile , 0 , binaryFile.Length );
bw.Close ( );
fs.Close ( );
this.Response.End ( );

}


主要代码~
用迅雷可以下载,但是用ie带的下载保存会出现:

Internet Exporer 无法下载downLoad.aspx(来自localhost)
Internet Exporer 无法打开该internet站点。请求的站点不可用,或找不到。请以后再试!

下载网络上的其他文件是可以的,是哪里的设置问题呢?
困扰了好几天了~
...全文

相关推荐

评论 11
收藏 已收藏
分享
返回顶部
y63964632
.NET社区 62,272 成员 668,968 内容