database table info, table part structure:
info_id Int PRIMARY Key
File_mime_type varchar (50) file MIME type
file_size int File Size
Info_file image File
filename of the following code: getfile.asp
<%@ Language=vbscript%>
<!--#include file= "conn.asp"-->
<%
Info_id=request ("info_id")
Set Rs=server. CreateObject ("Adodb.recordset")
Sql= "SELECT * from Info where info_id=" & info_id
Rs. Open sql,conn,3,3
Response.contenttype=rs ("File_mime_type")
Response.AddHeader "Content-length", RS ("File_size")
Response.AddHeader "Content-disposition", "Attachment;filename=" "" "& RS (" file_name ") &" ""
Response.BinaryWrite rs ("Info_file")
Rs.close
Set rs=nothing
Conn.close
Set conn=nothing
%>
The way to get Pictures is
How do I get a file <a href=getfile.asp? info_id=xxxxxxx> Download File </a>
XXXXXXX is the primary key info_id value for the record
If you remove
Response.AddHeader "Content-length", RS ("File_size")
Response.AddHeader "Content-disposition", "Attachment;filename=" "" "& RS (" file_name ") &" ""
You can also display a picture, and the file will be saved with a getfile.asp download because no filename is specified.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service