Fpdf, permissions

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
jkashu
Forum Commoner
Posts: 45
Joined: Tue Jan 30, 2007 12:00 pm

Fpdf, permissions

Post by jkashu »

I am using Fpdf to create pdfs from text. The script creates the files flawlessly, however the permissions are set to 600, so no one can view the pdf files unless I manually go in and change the permissions.

This is the script that creates the pdfs:

Code: Select all

//Determine a temporary file name in the current directory
$tempfile=basename(tempnam(getcwd(),'pdf'));
rename($tempfile,$tempfile.'.pdf');
$tempfile.='.pdf';
//Save PDF to file
$pdf=new FPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','',12);
$pdf->Write(5,$text);
$pdf->Output($tempfile);
$text being the text that appears in the pdf file.

Any ideas?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Post Reply