📄 uploadfile.asp
字号:
<!--#include file="admin_include.asp"-->
<!--#include file="../inc/UpLoadClass.asp"-->
<%
Server.ScriptTimeOut=9999
if request.TotalBytes>0 then
set request2=new UpLoadClass
'设置文件允许的附件类型为gif/jpg/rar/zip
request2.FileType="rar/zip"
'设置文件大小
request2.MaxSize=0
'设置服务器文件保存路径
request2.SavePath="../Soft/"
'设置字符集
request2.Charset="gb2312"
request2.AutoSave=0
'打开对象
request2.Open()
if request2.Error=3 Then
set request2=nothing
response.Write("您要上传的是空白文件,或者您没有选择文件,请返回后重新选择!")
response.End()
end if
if request2.Error=1 Then
set request2=nothing
response.Write("您上传的文件过大!")
response.End()
end if
if request2.Error=2 Then
set request2=nothing
response.Write("不支持此种格式文件上传!")
response.End()
end if
Soft_Img = request2.form("Soft_Url") '软件图片
'response.Write(request2.form(formName&"_Err"))
response.Write(Soft_Img&"|上传成功!")
set request2=nothing
response.End()
end if
%>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="Css/main.css" rel="stylesheet" type="text/css" />
<title>软件上传</title>
<script language="javascript" src="../js/jquery.js"></script>
<script language="javascript" src="../js/jquery.form.js"></script>
<script language="javascript" src="../js/jquery.MultiFile.js"></script>
<script language="javascript">
<!--
function UploadFileCmd(){
if ($("input[@name=Soft_Url]").val() == ""){
alert("请先选择上传文件");
return false;
}
document.getElementById("sponsorAdDiv").innerHTML="<div style='color:#FF0000; height:30px; width:400px;'>正在上传,请稍等!</div>";
$("#UploadFileForm").ajaxForm(function(R){
R1 = R.split("|");
//alert(R)
if (R.search("成功")>=0){
ReHtml="<%=SiteUrl%>Soft/"+R1[0];
window.returnValue=ReHtml;
close();
}
else{
alert(R);
window.returnValue="";
}
})
}
function WinClose(){
opener=null;
self.close();
window.returnValue="";
}
-->
</script>
</head>
<body>
<div id="sponsorAdDiv" style="width:400px; margin-top:8px;"></div>
<form id="UploadFileForm" name="UploadFileForm" method="post" enctype="multipart/form-data" action="UploadFile.asp" onSubmit="return false;">
<input type="file" name="Soft_Url"/>
<input type="submit" class="submitCmd" value="上传" onClick="return UploadFileCmd()" />
</form>
<div><input type="submit" class="submitCmd" value="关闭" onClick="WinClose()" /></div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -