📄 upimage.asp
字号:
<%
'----------------------------------------------------------
'***************** 风声无组件上传类 2.0 *****************
'用法举例:快速应用[添加产品一]
'该例主要说明默认模式下的运用
'以常见的产品更新为例
'下面是上传程序(upload.asp)的代码和注释
'**********************************************************
'----------------------------------------------------------
Server.ScriptTimeOut=5000
%>
<!--#include FILE="UpLoadClass.asp"-->
<%
if session("flag")=2 then
%>
<%
dim request2
'建立上传对象
set request2=New UpLoadClass
'以默认设置打开上传对象
'建议直接修改类的63,64,65,66行为自己需要的默认设置
'类的初始默认值分别为
'p_MaxSize = 153600 单文件最大150K
'p_FileType = "jpg/gif" 允许上传jpg/gif格式文件
'p_SavePath = "" 在当前目录保存文件,这里是相对路径,如:“UpLoadFile/”
'p_AutoSave = 0 自动生成无重复文件名保存目标文件
'这样每次就不要设置同样的参数了
request2.MaxSize = 1536000 '单文件最大1500K
'request2.SavePath = "bilder/"&request2.Form("mapfl")&"/"
request2.AutoSave=2
request2.open()
if len(request2.Form("mapfl"))>2 then
response.write"<script>alert('非法上传路径。');history.back()</script>"
response.end
end if
dirsaved=replace(request2.Form("mapfl"),".asp",".htm")
request2.SavePath = "bilder/"&dirsaved&"/"
if CStr(request2.Form("map_imagestype"))<>"1" then
response.write"<script>alert('非法图片格式。');history.back()</script>"
response.end
end if
'if request2.Save("map","200522364068793.jpg") then
if request2.Save("map",0) then
'显示保存位置
Response.write "bilder/"&request2.Form("mapfl")&"/"
cc = LoadFile("bilder/"&request2.Form("mapfl")&"/bilder.txt")
dd = LoadFile("bilder/"&request2.Form("mapfl")&"/info.txt")
if len(cc)>24 then
cc = cc & "|"&request2.Form("mapname")&"`"&request2.Form("map")
ccBEGIN = InStr(cc,"&anz_bilder=") + 12
ccEND = InStr(cc,"&fotos=")
ccCOUNT = CStr(CInt(mid(cc,ccBEGIN,ccEND-ccBEGIN))+1)
cc = "&anz_bilder="&ccCOUNT&mid(cc,ccEND)
dd = dd & "|"&request2.Form("shuoming")
ccBEGIN = InStr(dd,"&anz_bilder=") + 12
ccEND = InStr(dd,"&info=")
ccCOUNT = CStr(CInt(mid(dd,ccBEGIN,ccEND-ccBEGIN))+1)
dd = "&anz_bilder="&ccCOUNT&mid(dd,ccEND)
else
cc = "&anz_bilder=1&fotos="&request2.Form("mapname")&"`"&request2.Form("map")
dd = "&anz_bilder=1&info="&request2.Form("shuoming")
end if
call SaveToFile(cc,"bilder/"&request2.Form("mapfl")&"/bilder.txt")
call SaveToFile(dd,"bilder/"&request2.Form("mapfl")&"/info.txt")
end if
%>
<%
'释放上传对象
ROWids=LoadFile("bilder/config.txt")
ccbegin = InStr(ROWids,"&now_dir=")
ccEND = InStr(ROWids,"&ordner=")
now_dir1 = mid(ROWids,1,ccbegin-1)
now_dir2 = mid(ROWids,ccEND)
cc=now_dir1&"&now_dir="&request2.Form("mapfl")&now_dir2
call SaveToFile(cc,"bilder/config.txt")
set request2=nothing
'Response.end
Response.Redirect "editupfile.asp"
Response.end
%>
<%else%>
<%
response.write"<script>alert('请重新登录!');history.back();</script>"
response.end
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -