<% if trim(request("f2v"))<>"" then strFile = isAFile (trim(request("f2v"))) strPath= trim(Server.URLEncode(trim(request("f2v")))) strPath2= trim(request("f2v")) if right(strPath,"1")="/" or right(strPath,"1")="\" then strPath=left(strPath,(len(strPath)-1)) arrFile=split(trim(request("f2v")),"/") FileName=lcase(arrFile(uBound(arrFile))) if strFile= true then if instr(FileName,".zip") or instr(FileName,".jpg") or instr(FileName,".gif") or instr(FileName,".exe") or instr(FileName,".htm") or instr(FileName,".txt") then response.redirect "http://"&Request.ServerVariables("SERVER_NAME")&trim(request("f2v")) else response.write "请点击文件名打开文件，或点右键另存！"& fileName &"" end if else response.write strFile end if end if function isAFile(PersonalPath) PersonalPath=Server.Mappath(PersonalPath) dim fs Set fs = server.CreateObject("Scripting.FileSystemObject") if trim(PersonalPath)<>"" and fs.FileExists(PersonalPath) then isAFile=true elseif trim(PersonalPath)<>"" and fs.FolderExists(PersonalPath) then isAFile="您不能选择文件夹！" else isAFile="您没有选择任何文件！" end if set fs=nothing end function %>