checking file size with ajax php
Posted: Fri Apr 16, 2010 4:34 am
create checksize.php
copy past code,
now create reload.php
copy past this,
save it as reload.php and visit the checksize.php you should see it working. remember you can check any file, just rename index.html into something else
i'm using this to check how far video encoding has been done,
copy past code,
Code: Select all
<script src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"></script>
<script>
var auto_refresh = setInterval(
function()
{
$('#loaddiv').fadeOut('slow').load('reload.php').fadeIn("slow");
}, 400);
</script>
<div id="loaddiv"> </div>
now create reload.php
copy past this,
Code: Select all
<?php
$filename = 'index.html';
echo $filename . ': ' . filesize($filename) . ' bytes';
?>

i'm using this to check how far video encoding has been done,
