|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
由于ASP提供的是一对多的服务,所以用户的一些特殊需求很难得到满足。aspupload|上传uploadfile.asp
<!--#includefile=fileconfig.asp-->
<!doctypehtmlpublic"-//W3C//DTDHTML4.0Transitional//EN">
<html>
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<metaname="Keywords"content="">
<metaname="Author"content="haiwa">
<title>Upload</title>
<style>
<!--
*{font:12px;}
-->
</style>
</head>
<body>
<%
OnErrorResumeNext
Server.ScriptTimeOut=999999
ifrequest("act")="upload"then
dimfolder,savepath
savepath=Server.MapPath(UploadFilePath)
CreateFolder(savepath)
SetUpload=Server.CreateObject("Persits.Upload")
Upload.SetMaxSizeUploadLimitSize*1024,True
Upload.OverwriteFiles=false
ifRequest.QueryString("PID")=""then
Upload.ProgressID="010D60EB00C5AA4B"
else
Upload.ProgressID=Request.QueryString("PID")
endif
Count=Upload.Save(savepath)
IfErr.Number0Then
Response.Write"<divstyle=""color:red;font-size:12px;"">呈现毛病:"&Err.Number&"、"&Err.Description&"<ahref=""javascript:history.go(-1)"">从头上传</a></div>"
EndIf
IfErr.Number=8Then
Response.Write"<divstyle=""color:red;font-size:12px;"">你上传的文件凌驾限定("&UploadLimitSize/1024&"M)<ahref=""javascript:history.go(-1)"">从头上传</a></div>"
response.end
endif
diminputname
dimsize,rs_upfile
ForEachFileinUpload.Files
ifnotCanUpload(File.ext)then
File.Delete
response.write"<divstyle=""color:red;font-size:12px;"">"&file.filename&"("&file.size&")格局不准确!<ahref=""javascript:history.go(-1)"">从头上传</a></div>"
else
response.write"<divstyle=""color:green;font-size:12px;""><!--"&file.filename&"("&file.size&")-->上传乐成"%><ahref="javascript:history.go(-1)">从头上传</a></div><%
endif
next
else
%>
<%
dimSPid,PID,barref
SetUploadProgress=Server.CreateObject("Persits.UploadProgress")
SPid=UploadProgress.CreateProgressID()
PID="PID="&SPid
barref="framebar.asp?to=10&"&PID
%>
<SCRIPTLANGUAGE="JavaScript">
functionShowProgress()
{
strAppVersion=navigator.appVersion;
if(document.MyForm.FILE1.value!="")
{
if(strAppVersion.indexOf(MSIE)!=-1&&strAppVersion.substr(strAppVersion.indexOf(MSIE)+5,1)>4)
{
winstyle="dialogWidth=375px;dialogHeight:175px;center:yes;status:no";
window.showModelessDialog(<%=barref%>&b=IE,window,winstyle);
}
else
{
window.open(<%=barref%>&b=NN,,width=370,height=165,true);
}
}
returntrue;
}
functionchk()
{
if(MyForm.FILE1.value=="")
{
alert("请从硬盘选择你要上传的文件...");
returnfalse;
}
}
</SCRIPT>
<FORMNAME="MyForm"method="post"ENCTYPE="multipart/form-data"ACTION="?<%=PID%>&act=upload"OnSubmit="returnShowProgress();">
<INPUTNAME="FILE1"TYPE="FILE"SIZE="16"><inputname="Submit"type="submit"value="上传"onclick="returnchk()"></FORM>
<%endif%>
</body>
</html></p>由于ASP提供的是一对多的服务,所以用户的一些特殊需求很难得到满足。 |
|