📄 cimg_save.asp
字号:
<!--#include file="../../conn/dbconn2.asp"-->
<!--#include file="../../inc/safe.asp"-->
<%
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
'cimg=request("cimg")
set rs=server.createobject("adodb.recordset")
sql="select cimg from corporation where id="&id
rs.open sql,conn,1,3
file2=rs("cimg")
set fs=server.CreateObject("scripting.filesystemobject")
%>
<!--#include FILE="upload.inc"-->
<%
set upload=new upload_5xSoft ''建立上传对象
'--------将日期转化成文件名--------
formPath="pic/"
set file=upload.file("cimg") ''生成一个文件对象
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
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
thename=session("id")&MakedownName()&"."&FileExt
file2=server.MapPath(file2)
if fs.FileExists(file2) then
fs.DeleteFile file2,true
end if
'thename=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&right(file.filename,4)
'file.filename=thename
file.SaveAs Server.mappath(formPath&thename)
imgs=thename
else
response.write"<SCRIPT language=JavaScript>alert('未此到该图片或该图片为零字节!');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
end if
rs("cimg")="pic/"&imgs
rs.Update
rs.close
Set rs=nothing
Conn.Close
Set Conn=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 + -