美航母访香港被拒,僵尸勾女,蕾西·班哈德
download.?file=相对路径的文件
<%
2
3 call downloadfile(replace(replace(request("file"),"",""),"/",""))
4
5 function downloadfile(strfile)
6 make sure you are on the latest mdac version for this to work
7 -------------------------------------------------------------
8
9
10 get full path of specified file
11 strfilename = server.mappath(strfile)
12
13
14 clear the buffer
15 response.buffer = true
16 response.clear
17
18 create stream
19 set s = server.createobject("adodb.stream")
20 s.open
21
22 set as binary
23 s.type = 1
24
25 load in the file
26 on error resume next
27
28
29 check the file exists
30 set fso = server.createobject("scripting.filesystemobject")
31 if not fso.fileexists(strfilename) then
32 response.write("<h1>error:</h1>" & strfilename & " does not exist<p>")
33 response.end
34 end if
35
36
37 get length of file
38 set f = fso.getfile(strfilename)
39 intfilelength = f.size
40
41
42 s.loadfromfile(strfilename)
43 if err then
44 response.write("<h1>error: </h1>" & err.description & "<p>")
45 response.end
46 end if
47
48 send the headers to the users browser
49 response.addheader "content-disposition", "attachment; filename=" & f.name
50 response.addheader "content-length", intfilelength
51 response.charset = "utf-8"
52 response.contenttype = "application/octet-stream"
53
54 output the file to the browser
55 response.binarywrite s.read
56 response.flush
57
58
59 tidy up
60 s.close
61 set s = nothing
62
63
64 end function
65
66 %>
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复
Blazor server side 自家的一些开源的, 实用型项目的进度之 CEF客户端
.NET IoC模式依赖反转(DIP)、控制反转(Ioc)、依赖注入(DI)
vue+.netcore可支持业务代码扩展的开发框架 VOL.Vue 2.0版本发布
网友评论