HTTPS文件下载出现问题 在针对流的下载时出现的问题描述: 一段JAVA文件下载代码如下: string strFileName=""; strFileName=dtsDoc
Tables[0]
Rows[0]["cFileName"]
ToString(); Response
Clear(); //Response
ContentType = "application/octet-stream"; Response
ContentType = dtsDoc
Tables[0]
Rows[0]["cTypeName"]
ToString(); Response
AddHeader("Content-Disposition", "attachment; filename= "+ HttpUtility
UrlEncode(strFileName, System
Encoding
UTF8)); byte[] bFile = (byte[])dtsDoc
Tables[0]
Rows[0]["gAddition"]; Response
OutputStream
Write(bFile,0,bFile
Length); //Response
BinaryWrite(bFile); Response
Flush(); 此代码在Http协议下运行正常,可以下载文件
但是放入Https协议下就不好用 一选择保存,IE便提示:IE无法下载,请求站点不可用或找不到 解决办法:只要把清除缓存的代码去掉就行
(经过中电投ERP 公司代码验证验证) SSL客户端下载文件,https下载文件需要注意的事情: 1、完成下载文件程序在http下测试通过,而 https下总是报页面错误
2、主要跟response中的header有关
设置添加了response
addHeader("