Php 如何在CodeiCenter中使用base64_编码附加pdf

Php 如何在CodeiCenter中使用base64_编码附加pdf,php,codeigniter,Php,Codeigniter,我的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(); 试试这个: $type =

我的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();
试试这个:

$type = pathinfo($file_name, PATHINFO_EXTENSION);
$base64 = 'data:application/pdf/' . $type . ';base64,' . base64_encode($data);

你能提供一些关于你所面临问题的更多信息吗。你试过什么?在研究修复程序时,您使用了哪些主题(例如,您在谷歌搜索了哪些内容等)?也请考虑看下面的文章,以确保社区成员能以最有效的方式帮助你。