未分類

8M 的迷失….

8M 的迷失….

下午程式寫好後…測驗Download 程式

發現Download 下來開一半會錯誤

改了很多東西…最後上網查才看到Key Message…

就是php.ini 設定8M的問題

ini_set(‘memory_limit’, ’50M’);

原來我Download 的大小超過8M

if(!eregi("usi", $_POST['c_email'])) { } else {
//Add User Log
$c_date = date("Y-m-d H:i:s");
$c_ip = $_SERVER["REMOTE_ADDR"];
$c_file = $row_rs_company['c_file'];
$addsql = "INSERT INTO tb_duser (c_sn,c_email,c_file,c_ip,c_date) VALUES ($_POST[c_sn],'$_POST[c_email]','$c_file','$c_ip','$c_date')";
$rs_save = mysql_query($addsql, $company) or die(mysql_error());
// Download Hit
$count = $_POST['c_sn'];
$query_rs_count = "UPDATE tb_company SET c_count = c_count + 1 WHERE c_sn = $count";
$rs_count = mysql_query($query_rs_count, $company) or die(mysql_error());
//Download company
if ($totalRows_rs_company > 0) {
$dl_file = $row_rs_company['c_file'];
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Content-Type: application/octet-stream");
$header="Content-Disposition: attachment; filename=".$dl_file.";";
header($header);
@readfile("ppt/".$dl_file);
}
} // c_email