<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_61069"> <div class="blockcode"> <div id="code_W9Z"><ol> <li>unction downloadFile($file){ </li> <li>$file_name = $file; </li> <li>$mime = 'application/force-download'; </li> <li>header('Pragma: public'); // required </li> <li>header('Expires: 0'); // no cache </li> <li>header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); </li> <li>header('Cache-Control: private',false); </li> <li>header('Content-Type: '.$mime); </li> <li>header('Content-Disposition: attachment; filename="'.basename($file_name).'"'); </li> <li>header('Content-Transfer-Encoding: binary'); </li> <li>header('Connection: close'); </li> <li>readfile($file_name); // push it out </li> <li>exit(); </li> <li>}</li> <li> </ol></div> <em onclick="copycode($('code_W9Z'));">复制代码</em> </div> <br> </td></tr></table> <div class="ptg mbm mtn"> PHP, 헤더</div> <div id="comment_61069" class="cm"> </div> <div id="post_rate_div_61069"></div> <br><br>