📄 uploadfile.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
Dim Upload
Dim IssueTime,FilePath,FileName,FormName,File1,FileAimPath
Dim Flag,Aim,AimString
Flag = False
'//得到上传路径
Path = server.MapPath("/")
If Right(path,1) <> "\" Then Path = Path + "\"
Path = Path + "pic\"
'//得到文件名前部名,后部分+ICount
GetNow = Now()
FileName = Cstr(Year(getNow)) + Cstr(Month(getNow)) + Cstr(Day(getNow)) + Cstr(Hour(getNow)) + Cstr(Minute(getNow)) + Cstr(Second(GetNow))
set FileUp=server.createobject("ChinaASP.UpLoad")
dim iCount,ExtName,FileNameTemp,ProductUrl
for each f in fileup.Files
ExtName = getFileExtName(f.fileName)
FileNameTemp = FileName + "." + ExtName
If (f.filesize<>0) and ((ExtName = "jpg") or (ExtName = "gif")) then
f.saveas Path + FileNameTemp
Flag = True
End If
next
Aim = trim(fileup.Form("ReturnFields"))
FileAimPath = "\\pic\\" + Cstr(FileNameTemp)
If Flag Then
Response.Write "<script>"
Response.write "var temp;"
Response.write "eval("&aim&"='"&FileAimPath&"');"
Response.Write "</script>"
End If
''//取得文件扩展名
Function GetExt(FilePath)
Dim S_string
If Len(FilePath) < 1 Then GetExt = ""
S_string = split(FilePath,".")
If Ubound(S_string) < 1 Then
GetExt = ""
Else
GetExt = S_string(Ubound(S_string))
End If
End Function
%>
<script language="JavaScript1.2">
window.close();
//location.href='uploadfileform.asp';
</script>
<%
'//----------
'获得文件的后缀名
function getFileExtName(fileName)
dim pos
pos=instrrev(filename,".")
if pos>0 then
getFileExtName=lcase(mid(fileName,pos+1))
else
getFileExtName=""
end if
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -