Jump to content

Modifying file permissions each time?(chmod related)


dannyb785

Recommended Posts

Ok, so at the moment, I have my site setup so that when I'm uploading an image to a folder, I do an ftp connect with my username, change the folder to 777, upload the pic, then change the folder back to 711, then disconnect. Thing is, sometimes I'm noticing that a folder or 2 every so often is still set to 777(when I view it in filezilla). So it made me think that perhaps the folder stays at 777 if the script is halted before changing back to 711(or perhaps for some other reason gets changed to 777).

 

So an idea I had was that in my php file that connects to my database(and does all other config details) that maybe I could create a long list of all my folders and set them to 711, no matter what they're currently set to? like:

$conn = connect();   // sign in as owner
change_perms($conn, '0711', 'photos');   // allow folder to be modified
change_perms($conn, '0711', 'thumbs');   // allow folder  to be modified
etc...
ftp_close($conn);

 

The thing is, this would be done every single page, so I figure it might be taking up too many resources. So maybe I should do a cronjob of setting folders to 711 every hour? or maybe every 24 hours? What would you recommend?

 

similar question, is 711 okay to set my folders to?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.