Ho trovato questa progressbar associata ad un upload.
Io vorrei sostituire l'upload proposto, con quello che stò usando io.
Purtroppo lo ho provato, così com'è, ma non funziona (lancio l'upload,
si apre il pop-up della barra, ma dopo qualche istante explorer mi
dice che non trova la pagina). Quale potrebbe essere l'errore?
ecco il codice:
progressupload.htm
codice:
<html>
<body>
<script language="javascript">
<!--
function DoUpload() {
theFeats = "height=120,width=500,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no";
theUniqueID = (new Date()).getTime() % 1000000000;
window.open("progressbar.asp?ID=" + theUniqueID, theUniqueID, theFeats);
document.myform.action = "progressupload.asp?ID=" + theUniqueID;
document.myform.submit();
}
//-->
</script>
<form name="myform" method="post" action="progressupload.asp" enctype="multipart/form-data">
<input type="file" name="filefield1">
<input type="button" name="dosubmit" value="Upload" OnClick="DoUpload()">
</form>
</body>
</html>
progressupload.asp
codice:
<%
Response.Expires = -10000
Server.ScriptTimeOut = 300
Set theForm = Server.CreateObject("ABCUpload4.XForm")
theForm.Overwrite = True
theForm.MaxUploadSize = 8000000
theForm.ID = Request.QueryString("ID")
Set theField = theForm.Files("filefield1")
If theField.FileExists Then
theField.Save theField.FileName
End If
%>
<html>
<body>
Upload Complete...
</body>
</html>
progressbar.asp
codice:
<%@EnableSessionState=False%>
<html>
<head>
<title>Progress...</title>
<meta http-equiv=refresh content="2,progressbar.asp?ID=<%=Request.QueryString("ID")%>">
<%
On Error Resume Next
Set theProgress = Server.CreateObject("ABCUpload4.XProgress")
theProgress.ID = Request.QueryString("ID")
%>
<script language="javascript">
<!--
if (<% =theProgress.PercentDone %> == 100) top.close();
//-->
</script>
</head>
<body bgcolor="#CCCCCC">
<table border="0" width="100%">
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Uploading:</font></td>
</tr>
<tr bgcolor="#999999">
<td>
<table border="0" width="<%=theProgress.PercentDone%>%" cellspacing="1" bgcolor="#0033FF">
<tr>
<td><font size="1"></font></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table border="0" width="100%">
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Estimated time left:</font></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1">
<%=Int(theProgress.SecondsLeft / 60)%> min
<%=theProgress.SecondsLeft Mod 60%> secs
(<%=Round(theProgress.BytesDone / 1024, 1)%> KB of
<%=Round(theProgress.BytesTotal / 1024, 1)%> KB uploaded)</font></td>
</tr>
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1">
Transfer Rate:</font></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1">
<%=Round(theProgress.BytesPerSecond/1024, 1)%> KB/sec</font></td>
</tr>
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Information:</font></td>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="1"><%=theProgress.Note%></font></td>
</tr>
</table>
</td>
</tr>
<tr></tr>
</table>
</body>
</html>
aiutooooo