checking file size with ajax php

Post Reply
Mysoogal
Captain
Captain
Posts: 223
Joined: Thu Dec 17, 2009 7:15 am
Location: Planet VPS

checking file size with ajax php

Post by Mysoogal » Fri Apr 16, 2010 4:34 am

create checksize.php

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'; 

?>
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 :mrgreen:

i'm using this to check how far video encoding has been done, :mrgreen:
Post Reply

Return to “PHP & MySQL”