Change file permissions upon file upload - PHP Print

  • file permission, chmod function, upload file
  • 0

Just use chmod() after your upload functions..

<?php

/* 
 * All your upload code here; then pass the filename
 * to the chmod below
 */

chmod($uploadedFile, 0644);

?>
 
Official documentation:

http://php.net/manual/en/function.umask.php

states:

"It is better to change the file permissions with chmod() after creating the file."

The documentation refers to the umask php function, however, the same principle applies in general.

 


Was this answer helpful?

« Back

Powered by WHMCompleteSolution