<table cellspacing="0" cellpadding="0"><tr><td class="t_f" id="postmessage_31041"> <div class="blockcode"> <div id="code_lil"><ol> <li> <li><?<li>if( empty($_GET['FileName'])|| empty($_GET['FileDir'])|| empty($_GET['FileId'])){<li>echo'<script> alert("非法连接 !"); location.replace ("index.php") </script>'; exit();</li> <li>}</li> <li>$file_name=$_GET['FileName'];</li> <li>$file_dir=$_GET['FileDir'];</li> <li>$FileId=$_GET['FileId'];</li> <li>$file_dir = $file_dir."/";</li> <li>if (!file_exists($file_dir.$file_name)) { //检查文件是否存在</li> <li>echo "文件找不到";</li> <li>exit;</li> <li>} else {</li> <li>$file = fopen($file_dir . $file_name,"r"); // 打开文件</li> <li>// 输入文件标签</li> <li>Header("Content-type: application/octet-stream");</li> <li>Header("Accept-Ranges: bytes");</li> <li>Header("Accept-Length: ".filesize($file_dir . $file_name));</li> <li>Header("Content-Disposition: attachment; filename=" . $file_name);</li> <li>// 输出文件内容</li> <li>echo fread($file,filesize($file_dir . $file_name));</li> <li>fclose($file);</li> <li>exit();</li> <li>}</li> <li>?></li> </ol></div> <em onclick="copycode($('code_lil'));">复制代码</em> </div> </td></tr></table> <div id="comment_31041" class="cm"> </div> <div id="post_rate_div_31041"></div> <br><br>