setting file 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
clearmedia
Forum Newbie
Posts: 3
Joined: Wed Jun 18, 2008 10:55 pm

setting file permissions

Post by clearmedia »

Hi all,

I need to know how to set permissions on text files.

The files are created dynamically so I need to set the permissions as the files are created.

I basically want my php script to still be able to read/write to the files, but not allow someone to access the file by url

Cheers
clearmedia
Forum Newbie
Posts: 3
Joined: Wed Jun 18, 2008 10:55 pm

Re: setting file permissions

Post by clearmedia »

all good people...

found out all i had to do was put the files outside the doc root then access them via $_SERVER['DOCUMENT_ROOT']."../somefile.txt";

Hope this may help someone else!
Post Reply