📄 cimg_save.asp
字号:
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../inc/safe.asp"-->
<!--#include FILE="../../inc/upload_5xsoft.inc"-->
<%
Response.Buffer = true
Response.ExpiresAbsolute=now()-1
Response.Expires=0
Response.CacheControl="no-cache"
%>
<%
if Not ChkPost then
response.redirect ("../../login/chklogin.asp?login=4")
response.end
end if
if session("flag")<>1 then
response.Redirect("../../login/vip.asp")
response.end
end if
%>
<%
if Chkrequest(request("id")) then
id=request("id")
else
Response.Redirect ("../../login/chklogin.asp?login=4")
end if
set upload=new upload_5xSoft
Dim objFSO '声明一个名称为 objFSO 的变量以存放对象实例
cimg_title=Replace_Text(upload.form("cimg_title"))
gsid=session("id")
user=session("user")
formPath=newspic
aformPath=user
''在目录后加(/)
if right(formPath,1)<>"/" then formPath=formPath&"/"
if right(aformPath,1)<>"/" then aformPath=aformPath&"/"
'iCount=0
for each formName in upload.objFile
set file=upload.file(formName)
if file.FileSize>0 then
if file.filesize>200000 then
response.write"<SCRIPT language=JavaScript>alert('您上传的图片大于规定大小(200K),请改变文件大小后再进行上传。');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
FileExt = Mid(file.Filename, InStrRev(file.Filename, ".")+1)
FileExt = FixName(FileExt)
If Not ( CheckFileExt(FileExt) and CheckFileType(File.FileType) ) Then
'if trim(right(file.FileName,3))<>"jpg" and trim(right(file.FileName,3))<>"gif" then
response.write"<SCRIPT language=JavaScript>alert('您上传的文件必须是gif|jpg|jpeg|bmp|png图象文件,请将你上传的文件转换为以上格式后再进行上传。');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
'FileName=gsid&MakedownName()&"."&mid(file.FileName,InStrRev(file.FileName, ".")+1)
FileName=aformPath&session("id")&MakedownName()&"."&FileExt
'开始判断会员图片目录是否存在
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists(Server.MapPath(""&formPath&""&aformPath&"")) Then'如果存在就直接保存图片
file.SaveAs Server.mappath(formPath&FileName)
Else
objFSO.CreateFolder(Server.MapPath(""&formPath&""&aformPath&""))'不存在就建一个目录
file.SaveAs Server.mappath(formPath&FileName)
End If
Set objFSO = Nothing '释放 FileSystemObject 对象实例内存空间
picture=FileName
end if
next
set file=nothing
set rs=server.createobject("adodb.recordset")
sql="select * from corporation where id="&id
rs.open sql,conn,1,3
if picture<>"" then
rs("cimg")=picture
end if
rs("cimg_title")=cimg_title
rs.update
rs.close
set rs=noting
conn.close
set conn=nothing
set upload=nothing
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>操作成功</title>
<link href="../../images/css.css" rel="stylesheet" type="text/css">
<meta HTTP-EQUIV=refresh Content='1;url=cimg_add.asp?id=<%=id%>'>
</head>
<table border="0" cellspacing="0" width="100%" cellpadding="0" height="418" style="border-collapse: collapse" bordercolor="#111111">
<tr>
<td width="100%" height="418" valign="middle" align="center">
<b>恭喜您,公司图片更新成功!<a href="cimg_add.asp?id=<%=id%>">返回</a></b></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -