peterbarone Posted February 13, 2011 Share Posted February 13, 2011 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 Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted February 13, 2011 Share Posted February 13, 2011 you don't want to chmod the tmp file, you want to chmod the uploaded file. If your having issues uploading to a directory, then you want to chmod the directory. Quote Link to comment Share on other sites More sharing options...
peterbarone Posted February 13, 2011 Author Share Posted February 13, 2011 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 ? Quote Link to comment Share on other sites More sharing options...
The Little Guy Posted February 13, 2011 Share Posted February 13, 2011 Try this: chmod($uploaddir.'/'.$_FILES['file']['name'],0777); Quote Link to comment Share on other sites More sharing options...
peterbarone Posted February 13, 2011 Author Share Posted February 13, 2011 THANKS ALOT. got the permission to change to 755. chmod($uploaddir.'/'.$_FILES['file']['name'],0777); Is there a better way to set the permission RE: 0777 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.