I have a regular form by using which users can upload files, which are then saved (or moved by move_uploaded_file()) to a specific directory. I'm on a shared server (running Apache 1.3.20 on Linux) which has PHP safe mode set to ON.
What I want to do is this:
1) chmod the destination directory permissions to 777
2) move the file with move_uploaded_file()
3) chmod the permissions back to 755
However, chmod() introduces problems, saying "Operation not permitted". UID's are the same for the executing script and the destination directory.
Is there some way to make this to work in safe mode? Wouldn't be too happy to leave the directory permissions to 777 for any freak to access.