I've got a little question, perhaps very easy to answer.
I'm writing a script to upload a file to a web server, and it's working great, ONLY if I have my directories set to 777. I tried to CHMOD the directories before upload to 777, then back to 755 once it's done, but I keep getting errors saying the operation wasn't authorized. The only way it will let me CHMOD or upload is 777. 775 won't even work.
So, question is...
I'm guessing this leaves a rather large loop hole in security on the web server, that I'd rather not contend with later, but deal with now before someone find this out and takes advantage. Any ideas on how to upload a file to a server CHMOD'd at 755 before upload, and 755 after upload?