FPDF saving to directory

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
neesley
Forum Commoner
Posts: 26
Joined: Tue Aug 31, 2010 3:22 am

FPDF saving to directory

Post by neesley »

Code: Select all

<?php
require('./pdf/fpdf.php');

$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'This is a test.');
$pdf->Cell(60,10,'Powered by FPDF.',0,1,'C');
$pdf->Cell(40,10,'Now is it working?');
$filename="test";
$pdf->Output("/test/" . $filename . ".pdf", 'F');
?>
I believe I have the correct permissions set for this to work correctly. But... this is the error I get:

Warning: fopen(/test/test.pdf) [function.fopen]: failed to open stream: No such file or directory in /home/content/d/a/n/danielneesley/html/dj/pdf/fpdf.php on line 1044
FPDF error: Unable to create output file: /test/test.pdf

Would someone walk me through which directory and files need to be set to 777? Many thanks as always.
Post Reply