Results 1 to 2 of 2

Thread: Change File Permission Using PHP Code

  1. #1
    Join Date
    Apr 2012
    Posts
    81
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Change File Permission Using PHP Code

    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.

    Code:
        $mpdf->WriteHTML($Htm);
        $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.

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 517 Times in 503 Posts
    Blog Entries
    5

    Default

    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?

Similar Threads

  1. file/folder permission in php
    By rohitnarang12 in forum PHP
    Replies: 1
    Last Post: 12-23-2010, 01:18 PM
  2. Permission to use code outside of Terms of Use/Service
    By karelia in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 07-19-2010, 11:59 PM
  3. Replies: 4
    Last Post: 04-15-2009, 02:27 AM
  4. Permission to use code outside of Terms of Use/Service
    By TheLastSuperman in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 11-28-2008, 06:25 PM
  5. Change contents of a .txt file with php Code Help
    By biggus in forum Looking for such a script or service
    Replies: 6
    Last Post: 10-03-2008, 09:24 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •