I found that there is no solution to the aspupload component. I will write my improvement solution here! Thank you
Solutions to the aspupload upload component, file renaming, progress bar problem!
There are 4 files in total, namely 1.asp, 2.asp, bar.asp, framebar.asp
Run the first file: 1.asp, perform the upload operation!
The code copy is as follows:
<%
'''Progress Bar
dimSPid,PID,barref
SetUploadProgress=Server.CreateObject("Persits.UploadProgress")
SPid=UploadProgress.CreateProgressID()
PID="PID="&SPid
barref="framebar.asp?to=10&"&PID
%>
<SCRIPTlanguage="javascript">
<!--
functionShowProgress()
//Loading progress bar
{
strAppVersion=navigator.appVersion;
if(document.upfile.filename.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;
}
functionisPic(){
vartemp;
varExtList=".jpg.gif.bmp.png.swf";//Client, detect the file suffix name, so as not to report file type errors after uploading!
varfilename=upfile.filename.value;
varthe_ext=filename.substr(filename.lastIndexOf(".")+1).toLowerCase();
if(ExtList.indexOf(the_ext)==-1){
alert("Not a picture, please select the picture file!");
returnfalse;
}
returntrue;
}
//-->
</SCRIPT>
<html>
<head></head>
<body>
<formmethod="post"enctype="multipart/form-data"action="2.asp?<%=PID%>"name="upfile"OnSubmit="returnShowProgress();">
Select the file to upload: <br>
<inputtype=filename="filename"><br>
<inputtype=submitvalue="upload"onclick="returnisPic()">
</form>
</body>