📄 upload.asp
字号:
<!--#include file="conn.asp" -->
<!--#include file="inc/check.asp"-->
<!-- #include file="inc/info.asp" -->
<!-- #include file="inc/const.asp" -->
<!--#include FILE="inc/upfile_class.asp"-->
<%
dim upfile,formPath,ServerPath,FSPath,formName,FileName,oFile,sfilepath,isz
response.Write("<body bgcolor=""#fef5ce"" text=""#000000"" leftmargin=""0"" topmargin=""0"" marginwidth=""0"" marginheight=""0"">")
set upfile=new upfile_class
if fval(websetting(14))>0 then
upfile.GetData (int(fval(websetting(14)))*1024)
else
upfile.GetData (10*1024) '10kb
end if
if upfile.err > 0 then 'if err
select case upfile.err
case 1
Response.Write easeuploaderr1
case 2
Response.Write easeuploaderr2 & fval(websetting(14))&"KB"
end select
else
FSPath=GetFilePath(Server.mappath("upload.asp"),"\")
ServerPath=GetFilePath(Request.ServerVariables("HTTP_REFERER"),"/")
for each formName in upfile.file
set oFile=upfile.file(formname)
fileExt=lcase(ofile.FileExt)
if CheckFileExt(fileEXT)=false then
response.write easeuploaderr3
response.end
end if
select case lcase(upfile.form("filepath"))
case "upload"
filepath="upload"
case "shopimg"
filepath="shopimg"
case else
response.write easeuploaderr4
response.end
end select
FileName=user&"_"&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&"."&fileExt
if not FileName>"" then FileName=oFile.filename
oFile.SaveToFile FSPath&filepath&"/"&FileName
set oFile=nothing
next
response.write "<script>parent.document.myform.imageurl.value='"&filepath&"\/"&Filename&"'</script>"
response.write easeuploadokstr
end if
set upfile=nothing
Private Function CheckFileExt (fileEXT)
dim aspeaseupload
aspeaseupload="gif,jpg,jpeg"
aspeaseupload=split(aspeaseupload,",")
for i=0 to ubound(aspeaseupload)
if lcase(fileEXT)=lcase(trim(aspeaseupload(i))) then
CheckFileExt=true
exit Function
else
CheckFileExt=false
end if
next
End Function
function GetFilePath(FullPath,str)
If FullPath <> "" Then
GetFilePath = left(FullPath,InStrRev(FullPath, str))
Else
GetFilePath = ""
End If
End function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -