📄 uploadfile2.asp
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<!--#include file="admin_include.asp"-->
<link href="Css/main.css" rel="stylesheet" type="text/css" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="javascript" src="../js/jquery.js"></script>
<title>图片上传</title>
<style>
<!--
#sponsorAdDiv {position:absolute;}
body {
background:#f5f5f5;
width:350px;
text-align:left;
margin:0px;
}
.Upload_img {
width:expression(document.body.clientWidth > 100? "100px": "auto" );
cursor:pointer;
}
-->
</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
adTime=8;
chanceAd=1;
var ns=(document.layers);
var ie=(document.all);
var w3=(document.getElementById && !ie);
adCount=0;
function initAd(){
if(!ns && !ie && !w3) return;
if(ie) adDiv=eval('document.all.sponsorAdDiv.style');
else if(ns) adDiv=eval('document.layers["sponsorAdDiv"]');
else if(w3) adDiv=eval('document.getElementById("sponsorAdDiv").style');
randAd=Math.ceil(Math.random()*chanceAd);
if (ie||w3)
adDiv.visibility="visible";
else
adDiv.visibility ="show";
if(randAd==1) showAd();
}
function showAd(){
if(adCount<adTime*10){adCount+=1;
if (ie){documentWidth =document.body.offsetWidth/2+document.body.scrollLeft-20;
documentHeight =document.body.offsetHeight/2+document.body.scrollTop-20;}
else if (ns){documentWidth=window.innerWidth/2+window.pageXOffset-20;
documentHeight=window.innerHeight/2+window.pageYOffset-20;}
else if (w3){documentWidth=self.innerWidth/2+window.pageXOffset-20;
documentHeight=self.innerHeight/2+window.pageYOffset-20;}
adDiv.left=0;adDiv.top =documentHeight-0;
setTimeout("showAd()",100);}
}
function closeAd(){
if (ie||w3)
adDiv.display="none";
else
adDiv.visibility ="hide";
}
function ReUpload2(FileName,op){
if (confirm("点击确定会删除该文件\n确定重新上传文件吗?")){
$.get(
"Upload2.asp?FileName="+FileName+"&op="+op,
function(ReText){
if (ReText.search("成功")>0){
//alert(ReText);
frames.location.href='UploadFile2.asp';
}
else
alert("系统错误,请重新上传!")
location.href="UploadFile2.asp";
}
)
}
}
function ShowImg2(ImgSrc){
var ImgBox = document.getElementById("ImgBox");
var ImgCmd = document.getElementById("ImgCmd");
parent.document.all['ifrName'].style.height='75px';
ImgBox.innerHTML = "<img class='Upload_img' src='../images/upload/"+ImgSrc+"' alt='点击放大' onclick='SizeChange2(this);' />";
ImgCmd.innerHTML = "取消";
ImgCmd.href = "javascript:HiddenImg2('"+ ImgSrc +"')";
}
function HiddenImg2(ImgSrc){
var ImgBox = document.getElementById("ImgBox");
var ImgCmd = document.getElementById("ImgCmd");
parent.document.all['ifrName'].style.height='22px';
ImgBox.innerHTML = "";
ImgCmd.innerHTML = "查看";
ImgCmd.href = "javascript:ShowImg2('"+ ImgSrc +"')";
}
function SizeChange2(obj){
if (obj.style.width == "500px"){
obj.style.width='100px';
parent.document.all['ifrName'].style.height='75px';
obj.alt='点击放大';
}
else{
obj.style.width='500px';
parent.document.all['ifrName'].style.height='350px';
obj.alt='点击缩小'
}
}
-->
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
ImgSrc = request.QueryString("ImgSrc")
id = request.QueryString("id")
if ImgSrc="" then
%>
<div id="sponsorAdDiv" style="visibility:hidden; width:400px; margin-top:8px; background:#f5f5f5;">
<div style="color:#FF0000; height:30px; width:400px;">正在上传,请稍等!</div>
</div>
<table border="0" cellspacing="0" cellpadding="0" height="10">
<form method="post" action="Upload2.asp" enctype="multipart/form-data" name="form2" onSubmit="initAd();">
<tr>
<td align="left"><input name="sf_upfile" type="file" style="width:250px;"> <input type="submit" name="submit" class="submitCmd" value="上 传" style="height:20px;"></td>
</tr>
</form>
</table>
<%
else
session("UploadFile")=ImgSrc
response.Write("文件名:"&ImgSrc&"<span id='ImgBox'></span>[<a id='ImgCmd' href=""javascript:ShowImg2('"& ImgSrc &"');"">查看</a>][<a href=""javascript:ReUpload2('"&ImgSrc&"',"&id&");"">重新上传</a>]")
end if%>
</body>
<%
call pagend()
%>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -