$user_path=$_SERVER['DOCUMENT_ROOT']."/uploads/up/"; $filename = date('YmdHis',time()).'商品信息.xlsx'; $filename = iconv("utf-8","gb2312",$filename); $objWriter = PHPExcel_IOFactory::createWriter($this->objPHPExcel, 'Excel2007'); // ob_end_clean(); // header("Pragma: public"); // header("Expires: 0"); // header("Cache-Control:must-revalidate, post-check=0, pre-check=0"); // header("Content-Type:application/force-download"); // Header("Content-type: applicationnd.ms-excel ;charset=utf-8"); // header("Content-Type:application/octet-stream"); // header("Content-Type:application/download"); // header("Content-Disposition:attachment;filename=".$filename); // header("Content-Transfer-Encoding:binary"); // $objWriter->save("php://output"); $objWriter->save($user_path.$filename); }