日期:2014-05-17 浏览次数:20482 次
$id=empty($_GET['id'])?1:intval($_GET['id']); $sourceName = 'filetoupload' . $i; $imageArray = array(); $message = "Image $i has been uploaded to the server"; echo $message; if ($id>=100){ exit(); } $id++; $msg.="<META HTTP-EQUIV=Refresh CONTENT=0;URL=?id=".$id.">"; echo $msg; exit();
------解决方案--------------------
为这问题 我开启了好久没用的linux 最终发现是缓存的问题
<?php ob_start(); for($i = 1; $i <= 100; $i++){ ob_end_flush();//关闭缓存 $sourceName = 'filetoupload' . $i; $imageArray = array(); $message = "Image $i has been uploaded to the server"; echo $message; flush(); ob_flush(); usleep(500000); } ob_end_flush(); ?>
------解决方案--------------------
ob_end_clean(); apache_setenv('no-gzip', 1); ini_set('zlib.output_compression', 0); ini_set('implicit_flush', 1); ob_start();//开始缓冲数据 for($i = 1; $i <= 100; $i++){ $sourceName = 'filetoupload' . $i; $imageArray = array(); $message = "Image $i has been uploaded to the server<br/>"; echo $message.str_repeat(" ",1024);//ie有默认的1k buffer ob_flush(); flush(); usleep(500000); }