Jump to content

Chmod a file


peterbarone

Recommended Posts

I'm having a problem setting file permissions. Can someone give a little guidance.

 

if(is_uploaded_file($_FILES['file']['tmp_name'])){
           move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']);
           chmod($_FILES['file']['tmp_name'],0777);

 

The permissions are not being set ? I made sure the dir was chmod correct. 

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/227542-chmod-a-file/
Share on other sites

if(is_uploaded_file($_FILES['file']['tmp_name'])){
           move_uploaded_file($_FILES['file']['tmp_name'],$uploaddir.'/'.$_FILES['file']['name']);
            if(strtoupper(substr(PHP_OS,0,3))!="WIN")
             @chmod($_FILES['file']['name'],0777);
		 }

 

Thanks for that find, my typo.  still loading the file to 640.  Any other ideas ?

 

 

Link to comment
https://forums.phpfreaks.com/topic/227542-chmod-a-file/#findComment-1173729
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.