Posted by yanlu06 on 04/25/06 22:24
I tried to use HTML2FPDF to generate dynamic local files and save the
generated files on the server. I don't know why it gives me the
following error message:
" Warning: fopen(gen_pdf/gen_pdf/yan.pdf) [function.fopen]: failed to
open stream: No such file or directory in
/export/home/.../pdfCov/fpdf.php on line 1698
FPDF error: Unable to create output file: gen_pdf/yan.pdf "
I cut and paste the following part of the code into a test.php file and
run it. the test file can generate text file without any problem:
$name="testfile.pdf";
$handle = file_exists('gen_pdf/'.$name);
if (!$handle)
{
$f = fopen('gen_pdf/'.$name,'x+');
}
if(!$f) $this->Error('Unable to create output file: '.$name);
fwrite ($f,"testtest");
//fwrite($f,$this->buffer,strlen($this->buffer)); //this line is in
fpdf.php to generate pdf contents
fclose($f)
Anyone can help me out?
Thanks!
[Back to original message]
|