📄 questinoimgsub.asp
字号:
<!--#include file="../Include/Conn.asp"-->
<%
set rs=server.createobject("adodb.recordset")
Dim AppealNum,AppealCount
AppealNum=90 '----------页面60秒打开网页次数的限制-----------
AppealCount=Request.Cookies("AppealCount")
If AppealCount="" Then
response.Cookies("AppealCount")=1
AppealCount=1
response.cookies("AppealCount").expires=dateadd("s",60,now())
Else
response.Cookies("AppealCount")=AppealCount+1
response.cookies("AppealCount").expires=dateadd("s",60,now())
End If
if int(AppealCount)>int(AppealNum) then
response.write "为防止恶意上传文件,请您等待60秒后再上传文件.<br>为您带来不便,请谅解!"
response.end
End If
%>
<!--#include FILE="uploadClass.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>上传系统</title>
<style>
body { font-size:9pt }
</style>
<base href="文件上传结果"></head>
<body style="margin:0px;">
<p align="center">
<script language="Javascript">
function minipic(smileface)
{
window.opener.document.form1.minipic.value=smileface;
}
function pic(smileface)
{
window.opener.document.form1.pic.value=smileface;
}
</script>
<%
Question_id=request.QueryString("Question_id")
i=request.QueryString("i")
Question_img_new=""
folderPath="../UploadImg"'用于在管理文件夹下的访问的文件夹相对路径
folderPath2="UploadImg"'用于在主目录下面访问的相对图片存放的文件夹
set upload=new upload_5xsoft
set file=upload.file("sf_upfile")
if file.fileSize<1 then
response.write"<script language=javascript>alert('您没有选择文件:\n\n-----请点击浏览按钮,从弹出的窗口中选择要上传的文件。\n\n-----然后点击上传按钮就可以把文件上传了。\n\n-----不过要注意上传文件的格式哦。');history.back()</script>"
response.end
end if
if file.fileSize<10 or file.fileSize>100*1024 then '-------修改默认的数值 100 单位(KB)-----
response.write "错误:上传的文件大小超过了限制! <a href='javascript:history.go(-1)'>退回上一步</a>"
response.end
end if
upfilename = split(file.FileName,".")
upfileext = upfilename(ubound(upfilename))
'------------在下面设置上传文件类型,增加( and upfileext<>"文件类型" )----------
if upfileext<>"gif" and upfileext<>"GIF" and upfileext<>"jpg" and upfileext<>"JPG" and upfileext<>"jpeg" and upfileext<>"JPEG" then
response.write "错误:上传的文件格式不对! <a href='javascript:history.go(-1)'>退回上一步</a>"
response.end
end if
ufp="dxsurvey_lq_"&day(now)&hour(now)&minute(now)&second(now)&"."&upfilename(ubound(upfilename))
file.saveas Server.mappath(folderPath&"/"&ufp)
picname="[up]"& ufp &"[/up]"
sql="select Question_img from [Question] where Question_id="&Question_id
rs.open sql,conn,1,3
Question_img=split(rs(0),"&")
Question_img(i)=folderPath2&"/"&ufp
for j=0 to ubound(Question_img)
if Question_img_new="" then
Question_img_new=Question_img(j)
else
Question_img_new=Question_img_new&"&"&Question_img(j)
end if
next
rs("Question_img")=Question_img_new
rs.update
rs.close
response.write "图片上传成功[ <a href='javascript:history.go(-1)'>我要重新上传</a> ]</a>"
%>
<%
set file=nothing
set upload=nothing
'set my_conn = nothing
'set rs = nothing
%>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -