Page 1 of 1

How to pass (chmod 777) permission while writing a file

Posted: Fri Dec 22, 2006 12:34 am
by eshban
Hi,

I have just writing a file by using fwrite method. But when i upload my code and check it online, it does not allow my code to write my file.

Please guide that how can i pass PERMISSION (777) in my PHP code while writing the file.

Thank you

Posted: Fri Dec 22, 2006 12:50 am
by dibyendrah

Code: Select all

<?php
chmod("file_name", 0777);
?>
But don't do 777 as it's not secure as well and server might not allow to do that as well. Safe will be do 666 rather than 777.