filelist_download.asp

来自「aspupload」· ASP 代码 · 共 31 行

ASP
31
字号
<%
' AspUpload Code samples: filelist_download.asp
' Invoked by filelist.asp
' Copyright (c) 2001 Persits Software, Inc.
' http://www.persits.com

' The file must not contain any HTML tags, not even HTML comment tags <!-- ...-->

	' Build ADO connection string
	Connect = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath(".\aspupload.mdb")

	' If you use SQL Server, the connecton string must look something like this:
	' Connect = "Provider=SQLOLEDB;Server=MYSRV;Database=master;UID=sa;PWD=xxx"

	Set db = Server.CreateObject("ADODB.Connection")
	db.Open Connect

	SQL = "SELECT * FROM MYIMAGES where id = " & Request("id")
	Set rs = db.Execute( SQL )
	If rs.EOF Then Response.End
	Response.ContentType = "application/octet-stream"
	
	' Let the browser know the file name
	Response.AddHeader "Content-Disposition", "attachment;filename=" & Trim(rs("filename"))

	' Let the browser know the file size
	Response.AddHeader "Content-Length", CStr(rs("filesize"))

	' Send actual file
	Response.BinaryWrite rs("image_blob")
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?