文件末尾加上
Response.ContentType="*/*"
Response.AddHeader "Content-Disposition","attachment;filename=""" & 文件名 & """"
Response.Write 文件内容
Response.ContentType="*/*"
Response.AddHeader "Content-Disposition","attachment;filename=""" & 文件名 & """"
Response.Write 文件内容
但是
请问,什么原理了?
Response.AddHeader "Content-Disposition","attachment;filename=""" & 文件名 & """"
Response.Write 文件内容
请标注释!
function DownURL(strRemoteURL,strLocalURL)
{
try
{
var xmlHTTP=new ActiveXObject("Microsoft.XMLHTTP");
xmlHTTP.open("Get",strRemoteURL,false);
xmlHTTP.send();
var adodbStream=new ActiveXObject("ADODB.Stream");
adodbStream.Type=1;//1=adTypeBinary
adodbStream.Open();
adodbStream.write(xmlHTTP.responseBody);
adodbStream.SaveToFile(strLocalURL,2);
adodbStream.Close();
adodbStream=null;
xmlHTTP=null;
//OpenFile(strLocalURL);
}
catch(e)
{
window.confirm("下载URL出错!");
}
//window.confirm("下载完成.");
}
</script>
需要降低IE属性,有时看ADODB.Stream是否禁用.
如果要的話,可email聯係:[email protected]