|
Home All Articles Contact Zawgyi Myanmar Font |
|
Home >> Snippet List >> Snippet Name Buffered Download codeDescription For downloading very large files (10 meg or more), split the file into chunks when sendingPHP Snippet <?php //start buffered download WHILE(!feof($fp)){ $total = filesize($file); $sent = 0; $blocksize = (2 << 20); //2M chunks $handle = fopen($file, "r"); // Now we need to loop through the file // AND echo out chunks of file data WHILE($sent < $total){ echo fread($handle, $blocksize); $sent += $blocksize; } EXIT(0); @flush(); @ob_flush(); } ?> |
|
All photograph,logos, articles, comments and trademarks etc, in this site are property of their respective owners.All the rest (c) 2006 by PhpMyanmar.com. |