我的pdf文件附件已损坏。
这是我的代码:
$buffer = chunk_split(base64_decode($row->arquivo));
$name = $row->nome_arquivo;
$extensao = $row->extensao;
$this->email->attach($buffer, 'attachment', $name, $extensao);
$this->email->send();
答案 0 :(得分:0)
尝试:
$type = pathinfo($file_name, PATHINFO_EXTENSION);
$base64 = 'data:application/pdf/' . $type . ';base64,' . base64_encode($data);