<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_51089"> <div class="blockcode"> <div id="code_oA1"><ol> <li>function save($word_name)</li> <li> {</li> <li> </li> <li> echo "</html>";</li> <li> $data = ob_get_contents();</li> <li> ob_end_clean();</li> <li> $this->wirtefile ($word_name,$data) ;</li> <li> }</li> <li> </li> <li> function wirtefile ($word_name,$data)</li> <li> {</li> <li> $path = 'public/uploads/'.$word_name;</li> <li> $file = fopen($path,"wd");</li> <li> fwrite($file, $data);</li> <li> fclose($file);</li> <li> $file = fopen($path,"r");</li> <li> Header("Content-type: application/octet-stream");</li> <li> Header("Accept-Ranges: bytes ");</li> <li> Header("Accept-Length: ".filesize($path));</li> <li> Header("Content-Disposition:attachment; filename=".basename($path));</li> <li> echo fread($file, filesize( $path));</li> <li> fclose($file);</li> <li> unlink($path);</li> <li> $this->index();</li> <li> }</li> </ol></div> <em onclick="copycode($('code_oA1'));">复制代码</em> </div> </td></tr></table> <div id="comment_51089" class="cm"> </div> <div id="post_rate_div_51089"></div> <br><br>