Why does my server keep creating new files with 0640 permissions in my PHP fwrite? -


i'm using simple fopen("w") , fwrite setup write new file on server. recently, has been arbitrarily assigning 0640 permissions these files, means can't view them browser. it's not happening every time. can tell me why? i'm missing here? here's code:

if ($file=fopen("$filesdir/$yr/$mo/{$tempfile[0]}.xml","wb")) {     if(fwrite($file,$output,strlen($output))) {         $success="yes";         $message="file built.";     } else {         $message="could not write xml file.";     } } else {     $message="could not open file."; } 

i venture guess might have umask, or current permissions of directory creating file in. try adding sticky groups directory , keeping group www-data or apache (depending on install)


Comments

Popular posts from this blog

unicode - Are email addresses allowed to contain non-alphanumeric characters? -

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -