<%
' Define function, read binary data with ADODB.stream
Function Readbinaryfile (FileName)
Const adTypeBinary = 1
Dim Binarystream
Set Binarystream = CreateObject ("ADODB. Stream ")
Binarystream.type = adTypeBinary
Binarystream.open
Binarystream.loadfromfile FileName
Readbinaryfile = Binarystream.read
End Function
Response.AddHeader "Content-disposition", "attachment;filename=2.gif" ' filename
Response.ContentType = "Image/gif" setting (1)
Response. BinaryWrite Readbinaryfile (Server.MapPath ("2.gif")) ' is that you read the presence of local files to prevent others from knowing the true path of the stolen link.
%>
(1) The following example sets the ContentType property to another common value.
Text/html, I won't tell you this.
Image/gif GIF Pictures
image/jpeg jpg Pictures
APPLICATION/X-CDF CDF Documentation
Application/wma is the watermelon which music type
You can refer to a Web browser document or the current HTTP specification
In this way, the use of ASP storage session,cookies, and read HTTP first-class special features can be completely real implementation of anti-theft links, there is no cache, if the traffic is huge, I think the setting will be better.