[英]mPDF error: Unable to create output file: cache/Invoice.pdf
I am facing one problem on vtiger crm 我在vtiger crm上遇到一个问题
Error message is: 错误消息是:
mPDF error: Unable to create output file: cache/Invoice.pdf mPDF错误:无法创建输出文件:cache / Invoice.pdf
case 'F':
//Save to local file
$f=fopen($name,'wb');
if(!$f) $this->Error('Unable to create output file: '.$name);
fwrite($f,$this->buffer,strlen($this->buffer));
fclose($f);
break;
Check if you have permissions to create file. 检查您是否具有创建文件的权限。 Try specifying full path till file, like
$fileName = "/var/app/public_html/cache/Invoice.pdf"
尝试指定直到文件的完整路径,例如
$fileName = "/var/app/public_html/cache/Invoice.pdf"
Why are you using PHP way to save file that mPDF generates? 为什么用PHP方式保存mPDF生成的文件? Why not using
Output($fileName, $destinationType)
为什么不使用
Output($fileName, $destinationType)
$mpdf=new mPDF();
$mpdf->WriteHTML('<p>Hallo World</p>');
$mpdf->Output($fileName, 'D');
Documentation . 文件资料 。
make sure that file cache/Invoice.pdf is not open anywhere when you run script. 确保在运行脚本时未在任何地方打开文件cache / Invoice.pdf 。 if it's open somewhere else then TCPDF can't open it.
如果它在其他地方打开,则TCPDF无法打开它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.