This is an example, file name, and extension of data directly from the server database to the client file, can be written as needed. New / temp.htm requires true existence, in fact, there is no effect, just guiding, otherwise it is not possible to write the STRAM data. There are a lot of things in this area, but most of them are Copy, very simple things are so complicated. Really practical Dongdong is very poor. So I wrote one, although it is simple, some problems, but COPY can be used. Friends having problems can contact me, so learn together.
FilemyStream = Server.mappath ("new") & "/temp.htm" set mystream = server.createObject ("adodb.stream")
MyStream.Type = 1MYSTREAM.MODE = 3MYSTREAM.OpenMYSTREAM.LOADFROMFILE (FilemyStream)
Response.contentType = "Application / OcTet-Stream" response.addheader "Content-disposition:", "attachment; filename =" = mid (Request.ServerVariables ("http_range", 7)
Response.write "Name" response.write "account" response.write "address" response.write "Description" Cr = CHR (13) & chr (10) Response.write (CR)
While Not Rs.eof Response.write RS ("Name") Response.write RS ("Address") response.write RS ("Note") Response.write (CR) rs.movenext Wend
Rs.closset RS = NothingConn.closset conn = NothingMystream.closset MyStream = Nothing