PHP TCPDF错误:无法创建文件夹存在且具有正确权限的输出文件 [英] PHP TCPDF ERROR: Unable to create output file the folder exist and has the right permissions
本文介绍了PHP TCPDF错误:无法创建文件夹存在且具有正确权限的输出文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用html2pdf PHP类保存pdf文件. 代码是这样的:
I'm trying to save a pdf file using the html2pdf PHP class. The code is this:
$this->html2pdf->Output('directory/file_name.'.pdf', 'F');
但是我总是遇到此错误TCPDF错误:无法创建输出文件
But I have alway this error TCPDF ERROR: Unable to create output file
文件夹"folder"(名称很明显是一个例子),已经存在并且具有正确的权限!
the folder 'folder' (the name is an example, obviusly), exist and has the right permissions!
我试图省略文件夹名称,但是无论如何都会出现此错误...
I tryed to omit the folder name, but this error appear anyway...
有人可以帮助我吗?
推荐答案
如果删除完整的'if语句',则在'include/tcpdf_static.php'文件中,静态函数'fopenLocal'中的大约2435行...有效很好.
In the 'include/tcpdf_static.php' file about 2435 line in the static function 'fopenLocal' if I delete the complete 'if statement'... works fine.
public static function fopenLocal($filename, $mode) {
/*if (strpos($filename, '://') === false) {
$filename = 'file://'.$filename;
} elseif (strpos($filename, 'file://') !== 0) {
return false;
}*/
return fopen($filename, $mode);
}
这篇关于PHP TCPDF错误:无法创建文件夹存在且具有正确权限的输出文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文