📄 upphoto.asp
字号:
<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<!--#INCLUDE FILE="../HXINCLUDE/HX_photo.asp"-->
<%set upload=new upload_file:WS_Uid=upload.form("WS_Uid"):call WS_S.ChkIsOuter():filepath="../hximages/upfile/"
if (WS_Uid<>"" and not isnumeric(WS_Uid)) or WS_Uid="" then response.write "<script>alert('非法操作!');window.close();</script>":response.end
for each formName in upload.File
set file=upload.File(formName)
fileExt=lcase(file.FileExt) '得到的文件扩展名不含有.
if file.filesize<100 then HX_GoBack "请先选择你要上传的文件!",""
if fileext<>"gif" and fileext<>"jpg" and fileext<>"tif" and fileext<>"bmp" and fileext<>"png" then fileExt="gif":HX_GoBack "只能上传JPG,JPEG,GIF,TIF,BMP,PNG格式的图片!",""
if file.filesize>(1000*1024) then HX_GoBack "图片文件大小不能超过1m!"
if fileExt="asp" then fileExt="gif"
randomize:ranNum=int(90000*rnd)+10000:filename=filepath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt
FileSeverPath=Server.mappath(FileName)
WS_S.CheckDir FileSeverPath,True
if file.FileSize>0 then file.SaveToFile FileSeverPath
set file=nothing
next
if WS_S.HX_ScanFile(FileSeverPath) then
WS_S.CheckFile FileSeverPath,True
HX_GoBack "对不起,您上传的文件中含有木马程序,所以不能上传!",""
end if
ColumnName="":Tablename="HX_CompanyUser":Orderby=" where WS_Uid="&WS_Uid
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
if rs.recordcount>0 then WS_Photo=rs("WS_Photo")
if isnull(WS_Photo)=False and WS_Photo<>"" then
if WS_S.ChkObjInstalled("scripting.FileSystemObject") then
Filenamepath = Server.MapPath(WS_Photo)
Set fs = CreateObject("scripting.FileSystemObject")
If fs.FileExists(Filenamepath) Then fs.DeleteFile(Filenamepath)
set fs=nothing
end if
end if
rs("WS_Photo")=filename
rs.update
set upload=nothing
response.write "<script>alert('上传成功!');window.opener.location.reload();window.close();</script>"
response.end%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -