-1
데이터를 내보내고 첨부 파일로 Excel 파일을 삽입하고 싶습니다. codeigniter로 그것을하는 방법 2.2.4.데이터 내보내기 및 첨부 파일 보내기 Codeigniter
// PHP EXPORT DATA
...
...
$objWriter = IOFactory::createWriter($objPHPExcel, 'Excel5');
header('Content-type: application/vnd.ms-excel');
header('Content-Disposition: attachment; filename="test.xls"');
header('Cache-Control: max-age=0');
$objWriter->save('php://output');
// SEND MAIL
$this->load->library('email');
$this->email->from('[email protected]', 'Test');
$this->email->to('[email protected]', 'Test');
$this->email->subject('EXPORT DATA FILE');
$this->email->message("Test content");
$this->email->attach("INSERT HERE THE EXPORTED FILE");
try {
$this->email->send();
}
catch(Exception $e) {
echo $e->getMessage();
}
당신은 단지 어딘가에서 붙여 넣기 코드를 복사합니다. 컨트롤러와 모듈은 어디에 있습니까? –