【急求解】如何用xmlhttp 下载远程文件
获取远程的zip文件 把它输出到浏览器 弹出下载窗口 让用户下载 而不是用浏览器直接打开显示乱码
Response.Buffer = True
Dim objXMLHTTP, xml
Set xml = Server.CreateObject("Microsoft.XMLHTTP") '创建对象
xml.Open "GET","远程的rar文件 ",False '
xml.Send
Response.AddHeader "Content-Disposition", "attachment;filename="&mid(strFilePath,instrrev(strFilePath,"/")) '添加头给这个文件
Response.ContentType = "application/zip" '设置输出类型application/zip
Response.BinaryWrite xml.responseBody '输出二进制到浏览器
Response.Flush
Set xml = Nothing
这是我网上找到的。。效果不好。。
会直接打开显示乱码 下大文件的话半天没反应。。有什么改进的方法么