Pickle Posted March 12, 2010 Share Posted March 12, 2010 hi everyone I'm not sure if this is the right place for this question but here goes: I am currently working on an image upload script and i wanted to set the permissions for the target folder to 777 within the upload script and set it back to what it was after, so that i dont up the security risks of the site. However the hosting company wont seem to allow me to use the chmod function to change the permissions. They keep saying i need to set the folders permissions to 777 with my ftp but this isnt safe right? is there some kind of work around in this situation? any help/advice would be great. thanks Quote Link to comment https://forums.phpfreaks.com/topic/195015-image-upload-permissions/ Share on other sites More sharing options...
Pickle Posted March 12, 2010 Author Share Posted March 12, 2010 just to add to this, am i right in saying that i need to set the tmp folder and the folder that i move it to to 777. or does the move_uploaded_file function work even if the target folder is not 777? the hosting company have said that setting the temp folder to 777 and leaving all others the same is standard, thats how all other hosting companies make use of the temp folder. is that correct? Quote Link to comment https://forums.phpfreaks.com/topic/195015-image-upload-permissions/#findComment-1025215 Share on other sites More sharing options...
DataRater Posted March 12, 2010 Share Posted March 12, 2010 I think this is pretty normal. You could try having a cron job run every minute and move files to a more secure directory. Stephen Quote Link to comment https://forums.phpfreaks.com/topic/195015-image-upload-permissions/#findComment-1025239 Share on other sites More sharing options...
Pickle Posted March 12, 2010 Author Share Posted March 12, 2010 hi stephen thanks for replying, i was given the impression that setting folders to 777 permanently through ftp to allow file uploads was unsafe because it allowed others to upload malicious scripts to do damage to your site/database etc. is that what other developers do? set their folders to 777 and leave them like that? Quote Link to comment https://forums.phpfreaks.com/topic/195015-image-upload-permissions/#findComment-1025248 Share on other sites More sharing options...
Pickle Posted March 15, 2010 Author Share Posted March 15, 2010 hi does anyone else have any other thoughts on this? Quote Link to comment https://forums.phpfreaks.com/topic/195015-image-upload-permissions/#findComment-1026248 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.