在网站后台上传图片,显示上传成功,但是网站里并不能显示缩略图,请大神指点。上传编程文件为asp格式。 5
<%Server.ScriptTimeOut=9999999response.Buffer=true%><!--#includefile="../include/subc...
<%
Server.ScriptTimeOut=9999999
response.Buffer=true
%>
<!--#include file="../include/subconn.asp"-->
<!--#include FILE="UploadUp.asp"-->
<%
dim cls
if session("admin")="" then
Response.Redirect("admin.asp")
else
if session("flag")<>"0" then
cls = Instr(session("flag"), "prod")
if cls <= 0 then
%>
<script language="javascript">
if (confirm("您的操作权限不够,系统拒绝你的访问,请点确定返回,或者点取消退出重新登录"))
location.href="admin.asp";
else
location.href="quit.asp";
</script>
<%
end if
end if
end if
%>
<html>
<head>
<title>文件上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="css/Style.css" rel=stylesheet type=text/css>
<SCRIPT language=javascript>
function check()
{
var strFileName=document.form1.strFile1.value;
if (strFileName=="")
{
alert("请选择要上传的文件");
document.form1.strFile1.focus();
return false;
}
return true;
}
</SCRIPT>
</head>
<body class="a3">
<%
dim sortname,folder,formPath
formPath= "upload/"
contrl=request("contrl")
if contrl="" then contrl="photo"
folder=request("folder")
if folder<>"" then formpath=formpath & folder & "/"
up=request("up")
if up="up" then
%>
<table border="0" cellpadding="0" cellspacing="0" bordercolor="#3D5489"><tr><td>
<%
dim request2
'建立上传对象
set request2=New UpLoadClass
'上传总大小为1000M
request2.TotalSize= 1048576000
'单文件最大500M
request2.MaxSize = 100288000
'允许上传rar/zip格式文件
request2.FileType = "rar/zip/mp3/doc/jpg/gif/xls/swf/bmp/png/pdf/exe/txt/wmv/avi/mpg/mpeg"
request2.SavePath="../" & formPath
request2.open()
if request2.Error=-1 then
response.Write("请选则文件!")
elseif request2.Error=4 then
response.Write("总数据量超过限制,上传失败")
elseif request2.Error=1 then
response.Write "文件大小超过限制,允许最大文件为"&request2.MaxSize&"k"
elseif request2.Error=2 then
response.Write "文件格式不对!"
else
response.Write "<SCRIPT>parent.prodtable."&contrl&".value='"&replace(request2.SavePath,"../","")&request2.Form("strFile1")&"'</SCRIPT>"
response.Write("上传成功:<a href="&request2.SavePath&request2.Form("strFile1")&" target=_blank>"&request2.SavePath&request2.Form("strFile1")&"</a>")
end if
'释放上传对象
set request2=nothing
%>
</td></tr></table>
<%
up=""
response.End()
end if
%>
<form action="?up=up&contrl=<%=contrl%>&folder=<%=folder%>" enctype="multipart/form-data" name="form1" method="post" onSubmit="return check()">
<table border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#3D5489">
<td><input name="strFile1" type="file" id="strFile1"><input type="submit" name="Submit" value="上传"></td>
</tr>
</table>
</form>
</body>
</html> 展开
Server.ScriptTimeOut=9999999
response.Buffer=true
%>
<!--#include file="../include/subconn.asp"-->
<!--#include FILE="UploadUp.asp"-->
<%
dim cls
if session("admin")="" then
Response.Redirect("admin.asp")
else
if session("flag")<>"0" then
cls = Instr(session("flag"), "prod")
if cls <= 0 then
%>
<script language="javascript">
if (confirm("您的操作权限不够,系统拒绝你的访问,请点确定返回,或者点取消退出重新登录"))
location.href="admin.asp";
else
location.href="quit.asp";
</script>
<%
end if
end if
end if
%>
<html>
<head>
<title>文件上传</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK href="css/Style.css" rel=stylesheet type=text/css>
<SCRIPT language=javascript>
function check()
{
var strFileName=document.form1.strFile1.value;
if (strFileName=="")
{
alert("请选择要上传的文件");
document.form1.strFile1.focus();
return false;
}
return true;
}
</SCRIPT>
</head>
<body class="a3">
<%
dim sortname,folder,formPath
formPath= "upload/"
contrl=request("contrl")
if contrl="" then contrl="photo"
folder=request("folder")
if folder<>"" then formpath=formpath & folder & "/"
up=request("up")
if up="up" then
%>
<table border="0" cellpadding="0" cellspacing="0" bordercolor="#3D5489"><tr><td>
<%
dim request2
'建立上传对象
set request2=New UpLoadClass
'上传总大小为1000M
request2.TotalSize= 1048576000
'单文件最大500M
request2.MaxSize = 100288000
'允许上传rar/zip格式文件
request2.FileType = "rar/zip/mp3/doc/jpg/gif/xls/swf/bmp/png/pdf/exe/txt/wmv/avi/mpg/mpeg"
request2.SavePath="../" & formPath
request2.open()
if request2.Error=-1 then
response.Write("请选则文件!")
elseif request2.Error=4 then
response.Write("总数据量超过限制,上传失败")
elseif request2.Error=1 then
response.Write "文件大小超过限制,允许最大文件为"&request2.MaxSize&"k"
elseif request2.Error=2 then
response.Write "文件格式不对!"
else
response.Write "<SCRIPT>parent.prodtable."&contrl&".value='"&replace(request2.SavePath,"../","")&request2.Form("strFile1")&"'</SCRIPT>"
response.Write("上传成功:<a href="&request2.SavePath&request2.Form("strFile1")&" target=_blank>"&request2.SavePath&request2.Form("strFile1")&"</a>")
end if
'释放上传对象
set request2=nothing
%>
</td></tr></table>
<%
up=""
response.End()
end if
%>
<form action="?up=up&contrl=<%=contrl%>&folder=<%=folder%>" enctype="multipart/form-data" name="form1" method="post" onSubmit="return check()">
<table border="0" cellpadding="0" cellspacing="0">
<tr bgcolor="#3D5489">
<td><input name="strFile1" type="file" id="strFile1"><input type="submit" name="Submit" value="上传"></td>
</tr>
</table>
</form>
</body>
</html> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询