Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file permission settings when using file_put_content

Status
Not open for further replies.

southbeach

Programmer
Jan 22, 2008
879
US
I have a process that uses file_put_content() to write to disk - I am ending up with files like
Code:
--w----r-T 1 [URL unfurl="true"]www-data[/URL] [URL unfurl="true"]www-data[/URL] 1941640 Aug 14 12:16 job1149_BOL_b6ab74966c.pdf
--w----r-T 1 [URL unfurl="true"]www-data[/URL] [URL unfurl="true"]www-data[/URL] 1941640 Aug 14 12:14 job1150_BOL_87e880f9c3.pdf
--w----r-T 1 [URL unfurl="true"]www-data[/URL] [URL unfurl="true"]www-data[/URL] 1941642 Aug 14 11:55 job1151_BOL_493c0dbbb2.pdf
the directory in which I store these files is set to 775, not owned by but by my FTP user - this is so that I can FTP as needed. The group is 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?



--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top