Okay i had this problem, i had a 1.5 gig sql dump and i downloaded it and couldnt find a text
editor that could read it..... took forever to download as well... and what if you want to just
work in the cloud , dont have access to vi or ssh command line and you want to browse through
a giant log file, etc.... well here is my very basic big cloud file viewer... just place it in the directory with
a big file, change the $file = line to match your file and voila! im thinking of making a split function later if i get bored...
<?php
$file='bigassfile.sql';
echo $file.'<br><hr><br>';
$fp = fopen($file, 'r');
if (isset($_REQUEST["start"])){
$start=$_REQUEST["start"];
$chunksize=$_REQUEST["chunksize"];
} else {
$start=0;
$chunksize=512;
}
fseek($fp, $start);
$data = fread($fp, $chunksize);
echo '<textarea rows=20 cols=120 wrap off>'.$data.'</textarea><br><hr><br>';
echo '<a href="fileview.php?start='.($start+$chunksize+1).'&chunksize='
.$chunksize.'">next '
.$chunksize.'</a>';
fclose($fp);
?>