filemanagerviewfile.htm

来自「全方面的OA管理程序代码」· HTM 代码 · 共 42 行

HTM
42
字号
<!--#include file="../inc/Secure.htm"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<%	
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 "请点击文件名打开文件,或点右键另存!<a href=../"& strPath &">"& fileName &"</a>"
		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="<font color=#ff0000>您不能选择文件夹!</font>"
	else
		isAFile="<font color=#ff0000>您没有选择任何文件!</font>"
	end if
	set fs=nothing	
end function
%>
</body>
</html>

⌨️ 快捷键说明

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