文件使用数据库保存,使用
response.contenttype="application/x-zip-compressed"
response.binarywrite rst("content")
response.end
后,虽然可能下传,但文件名始终为asp页的,使用什么方法可以根据数据库中的文件名生成下传文件名!!
---------------------------------------------------------------
Response.AddHeader "content-disposition", "attachment;filename=" &clng(request("DateCount"))&".arz"
Response.BinaryWrite rs("U_tbl_file_sw")
---------------------------------------------------------------
这是我用的,是可以用的。
<%
set connGraph=server.CreateObject("ADODB.connection")
connGraph.ConnectionString="driver={Microsoft Access Driver (*.mdb)};DBQ=" & server.MapPath("images.mdb") & ";uid=;PWD=;"
connGraph.Open
set rec=server.createobject("ADODB.recordset")
strsql="select * from images where id=" & trim(request("id"))
rec.open strsql,connGraph,1,1
Response.ContentType = "application/zip"
Response.buffer = TRUE
Response.ContentType = "APPLICATION/OCTET-STREAM"
Response.AddHeader "Content-Disposition","attachment;filename="&rec("fname")
Response.BinaryWrite rec("img")
rec.close
set rec=nothing
set connGraph=nothing
Response.End
%>