⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 upfile_savefile.asp

📁 TSYS网站管理系统 TSYS网站管理系统 TSYS网站管理系统
💻 ASP
字号:
<%Option Explicit%>
<!--#include file="upload_5xsoft.asp" -->
<!--#include file="../Include/Config.asp" -->
<%
Dim FilePath,Fso
FilePath=Server.MapPath(Def_FileSystem_DirectoryRoot & Session("FilePath"))

Dim objUpLoad
Set objUpLoad = new upload_5xsoft
Dim formName,File,AutoRename
	AutoRename=objUpLoad.Form("AutoRename")="1"
For Each formName In objUpLoad.objFile
    Set File=objUpLoad.objFile(formName)
    '是否存在重名文件
    Set Fso = Server.CreateObject(Def_FsoObjectStr)

    If AutoRename=False And Fso.FileExists(FilePath &"/"& File.FileName) Then
        Set Fso=Nothing
        Response.Write("<script>alert(""<操作失败>\n存在同名文件"");"&_
                        "window.location=""UpFile_Iframe.asp""</script>")
        Response.End
	End If

	If InStr(Def_FileSystem_EnableFileExt,"|"&UCase(File.FileExt)&"|")=0 Then
		Response.Write("<script>alert(""<操作失败>\n文件类型不被允许"");"&_
						"window.location=""UpFile_Iframe.asp""</script>")
		Response.End
	End If

	If AutoRename Then
		file.SaveAs FilePath &"/"& Year(Now())&Right("00"&Month(Now()),2)&Right("00"&Day(Now()),2)&Right("00"&Hour(Now()),2)&Right("00"&Minute(Now()),2)&Right("00"&Second(Now()),2)&Round(Timer(),0)&"."&File.FileExt
	Else
		file.SaveAs FilePath &"/"& File.FileName
	End If

Next
Set objUpLoad=Nothing
%>
<SCRIPT LANGUAGE="JavaScript">
<!--
if(confirm("<操作成功>\n文件上传完毕,是否继续上传文件?(是/否)")){
	window.location="UpFile_Iframe.asp"	
}else{
	top.window.returnValue=true
	top.close()
}
//-->
</SCRIPT>

⌨️ 快捷键说明

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