CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 ::: PHP File Upload with Progress Meter ...

Print topic Send  topic

Author Message
klwillis


Posts: 428
Posted: 11/30/2004, 11:54 AM

Does anyone know of a good PHP script which shows
the progress of a file upload?

Maybe within a pop-up window, that closes after the upload
is complete.

_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message
Martin K.
Posted: 11/30/2004, 11:15 PM

Hello.
This is the progress Side in php:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php echo $caption; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">

<style type="text/css">

body {
background: #993300;
color: #ffffff;
font-family: Arial, sans-serif;

}

td.ProgressOn {
background: #0000ff;
}

td.ProgressOff {
background: #F2EEE0;
}

td.PageHeader {
font-weight: bold;
font-size: 12px;
text-align: center;
padding-bottom: 10px;
}

</style>

<script type="text/javascript">

function begin_progress() {

var i = 0;

setTimeout("update_progress(" + i + ", true)", 100);

}

function update_progress(i, forward) {

if (forward) {
if (i == 0) { off = i; }
else { off = (i - 1); }
} else {
if (i == 19) { off = i; }
else { off = (i + 1); }
}

eval("document.all.td" + off + ".className = \"ProgressOff\";");
eval("document.all.td" + i + ".className = \"ProgressOn\";");

if (forward) {
if (i == 19) {
forward = false;
i--;
} else {
i++;
}
} else {
if (i == 0) {
forward = true;
i++;
} else {
i--;
}
}

setTimeout("update_progress(" + i + ", " + forward + ")", 100);

}


function zentriermich() {
if(document.all) {
moveTo( ((screen.availWidth-document.all.body1.offsetWidth)/2),
((screen.availHeight-document.all.body1.offsetHeight-100)/2) );
}
if(document.layers){
moveTo( ((screen.availWidth-window.outerWidth)/2),
((screen.availHeight-window.outerHeight)/2) );
}
}

</script>

</head>

<body onLoad="begin_progress();zentriermich()">

<table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle">
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<td class="PageHeader"><?php echo $caption; ?></td>
</tr>
<tr>
<td>
<table border="0" cellpadding="5"
cellspacing="0" style="border: 1px inset;">
<tr>
<?php
for ($i = 0; $i < 20; $i++) {
echo "<td
class=\"ProgressOff\" id=\"td".$i."\"> </td>\n";
}
?>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>

</body>

</html>

#######################################################
In the Head from the Startside:

<script type="text/javascript">
var progress_window;
function open_progress_window(caption) {
progress_window = window.open("progress.php?caption=" + caption,"progress_window", "width=350, height=120, menubar=no, statusbar=no,toolbar=no");
}

function close_progress_window() {

if (progress_window != null) {
progress_window.close();
}

}
</script>
###############################################

In the Body from the Startside:

<body onunload="close_progress_window();">
################################################

In the href from your Startlink:

onclick="open_progress_window('Html+Seiten+werden+erstellt.+Please+do+not+close...');"

I hope you understand me.
Sorry about my english

by Martin
klwillis


Posts: 428
Posted: 12/02/2004, 8:40 AM

Thanks Martin.

I'll have to give this a try. ;-)

Quote Martin K.:
Hello.
This is the progress Side in php:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title><?php echo $caption; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">

<style type="text/css">

body {
background: #993300;
color: #ffffff;
font-family: Arial, sans-serif;

}

td.ProgressOn {
background: #0000ff;
}

td.ProgressOff {
background: #F2EEE0;
}

td.PageHeader {
font-weight: bold;
font-size: 12px;
text-align: center;
padding-bottom: 10px;
}

</style>

<script type="text/javascript">

function begin_progress() {

var i = 0;

setTimeout("update_progress(" + i + ", true)", 100);

}

function update_progress(i, forward) {

if (forward) {
if (i == 0) { off = i; }
else { off = (i - 1); }
} else {
if (i == 19) { off = i; }
else { off = (i + 1); }
}

eval("document.all.td" + off + ".className = \"ProgressOff\";");
eval("document.all.td" + i + ".className = \"ProgressOn\";");

if (forward) {
if (i == 19) {
forward = false;
i--;
} else {
i++;
}
} else {
if (i == 0) {
forward = true;
i++;
} else {
i--;
}
}

setTimeout("update_progress(" + i + ", " + forward + ")", 100);

}


function zentriermich() {
if(document.all) {
moveTo( ((screen.availWidth-document.all.body1.offsetWidth)/2),
((screen.availHeight-document.all.body1.offsetHeight-100)/2) );
}
if(document.layers){
moveTo( ((screen.availWidth-window.outerWidth)/2),
((screen.availHeight-window.outerHeight)/2) );
}
}

</script>

</head>

<body onLoad="begin_progress();zentriermich()">

<table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle">
<table border="0" cellpadding="5" cellspacing="0">
<tr>
<td class="PageHeader"><?php echo $caption; ?></td>
</tr>
<tr>
<td>
<table border="0" cellpadding="5"
cellspacing="0" style="border: 1px inset;">
<tr>
<?php
for ($i = 0; $i < 20; $i++) {
echo "<td
class=\"ProgressOff\" id=\"td".$i."\"> </td>\n";
}
?>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>

</body>

</html>

#######################################################
In the Head from the Startside:

<script type="text/javascript">
var progress_window;
function open_progress_window(caption) {
progress_window = window.open("progress.php?caption=" + caption,"progress_window", "width=350, height=120, menubar=no, statusbar=no,toolbar=no");
}

function close_progress_window() {

if (progress_window != null) {
progress_window.close();
}

}
</script>
###############################################

In the Body from the Startside:

<body onunload="close_progress_window();">
################################################

In the href from your Startlink:

onclick="open_progress_window('Html+Seiten+werden+erstellt.+Please+do+not+close...');"

I hope you understand me.
Sorry about my english

by Martin

_________________
Kevin Willis, VP/CIO
HealthCare Information Technology Specialist
http://www.nexushealthcare.com
"Fast - Convenient - Quality-Care"

Medical Software Consulting Services
Email : klwillis@nexushealthcare.com
Skype : klwillis2006
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.