|
- *************************
- .....................
- while not rs.eof
- response.write "<a href=""download.asp?file=" & Server.UrlEncode(filename) & """>下载</a><br>"
- rs.movenext
- ..............................
- 下面是download.asp
- <%
- Dim strFile
-
- strFile = Request.QueryString("file")
- If strFile <> "" Then
- Response.Buffer = False
- Dim objStream
- Set objStream = Server.CreateObject("ADODB.Stream")
- objStream.Type = 1 'adTypeBinary
- objStream.Open
- objStream.LoadFromFile("F:\ttasp" & strFile)
- Response.ContentType = "application/x-unknown"
- Response.Addheader "Content-Disposition", "attachment; filename=" & strFile
- Response.BinaryWrite objStream.Read
- objStream.Close
- Set objStream = Nothing
- End If
- %>
复制代码
循环列出,用户就可以点击下载。 |
|