View Full Version : Change File Permission Using PHP Code

04-25-2013, 11:13 AM
I am generating one PDF using mpdf, I put my partial code below.
I need to change its permission to 777 for overwrite authorization.
I am doing below procedure but i can not get new file permission as 777!!!
I set my uploaded directory permission to 777 with its sub-directories and files.

$mpdf->Output(SITE_PATH."/uploads/upload_documents/myfile.pdf",'F'); //Store output as PDF on this Path.
chmod(SITE_PATH."/uploads/upload_documents/myfile.pdf", 0777); //Change File Permission to 777

can any one help me ?
Thanks for any help.

04-25-2013, 03:22 PM
Are you getting any error messages?

Is chmod returning TRUE or FALSE?

What about $mpdf - have you made sure it is actually saving the file, at the expected location?