Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


file permission settings when using file_put_content

file permission settings when using file_put_content

file permission settings when using file_put_content

I have a process that uses file_put_content() to write to disk - I am ending up with files like


--w----r-T 1 www-data www-data 1941640 Aug 14 12:16 job1149_BOL_b6ab74966c.pdf
--w----r-T 1 www-data www-data 1941640 Aug 14 12:14 job1150_BOL_87e880f9c3.pdf
--w----r-T 1 www-data www-data 1941642 Aug 14 11:55 job1151_BOL_493c0dbbb2.pdf 
the directory in which I store these files is set to 775, not owned by www-data but by my FTP user - this is so that I can FTP as needed. The group is www-data, hence, 775 as permission, intended to give group full rwx permission in the directory.

I tried chmod() within PHP script after file_put_content but permission remain same.

My problem is that these files are temporary repository and need ability to open them (on demand) via browser - when attempting to open them, user gets permission denied or Forbidden message.

What am I missing or what is the proper permission settings to avoid this?

The good thing about not knowing is the opportunity to learn - Yours truly, 2008.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close