If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Add After:
[code=php]{literal}
<script>
(function ($) {
// We'll use this to cache the progress bar node
var pbar;
// This flag determines if the upload has started
var started = false;
$(function () {
// Start progress tracking when the form is submitted
$('#upload-video-form').submit(function() {
// Hide the form
$('#upload-video-form').hide();
// Cache the progress bar
pbar = $('#progress-bar');
// Show the progress bar
// Initialize the jQuery UI plugin
pbar.show().progressbar();
// We know the upload is complete when the frame loads
$('#upload-frame').load(function () {
// This is to prevent infinite loop
// in case the upload is too fast
started = true;
// Do whatever you want when upload is complete
alert('Upload Completed Successfully!');
});
// Start updating progress after a 1 second delay
setTimeout(function () {
// We pass the upload identifier to our function
updateProgress($('#uid').val());
}, 1000);
});
});
function updateProgress(id) {
var time = new Date().getTime();
// Make a GET request to the server
// Pass our upload identifier as a parameter
// Also pass current time to prevent caching
$.get('getprogress.php', { uid: id, t: time }, function (data) {
// Get the output as an integer
var progress = parseInt(data, 10);
if (progress < 100 || !started) {
// Determine if upload has started
started = progress < 100;
// If we aren't done or started, update again
updateProgress(id);
}
// Update the progress bar percentage
// But only if we have started
started && pbar.progressbar('value', progress);
});
}
}(jQuery));
</script>{/literal}[/code]

Make sure the code above is has the {literal} tag before the <script> tag and that the closing {/literal} follows the closing </script> tag.
Without the {literal}{/literal} tags, you will get a blank upload.php page due to the template reading the {} in the code.

Which looks correct to me. Beyond that there is a couple of configuration changes you need to hook it in.

As of 5.4, this library is no longer required since you can poll the sessions instead. The only thing you need to really do is verify that that PHP is working as expected. This will not be as easy as it sounds though; since the http is stateless, the only thing direct access can tell you is if the functions exist. Beyond that, you'll need to probably run a socket or curl test in order to test it out.
Everything else comes down to your javascript code.

PHP Code:

header('HTTP/1.1 420 Enhance Your Calm');

Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)