Okay, I've been reading for about two hours now and testing over and over without luck.
I want to have an authenticated user upload word documents to the server using an "upload" folder. Then I want to have the PHP script move the file to a protected directory. Currently, here's the code using the POST method:
// $userfile is name of file
$upfile = "/.../upload_directory/".$userfile_name;
$redirected = "/.../docs/".$userfile_name;
move_uploaded_file($userfile, $upfile);
copy($upfile, $redirected);
The "move" works fine. The "Copy" does not. If I change the DOCS folder to 777, then the copy works. The problem is I only want to have one folder (UPLOAD) with the open permissions. Then I just write a script for the uploads that distributes the files accordingly.
Is there a way to have the system move the file to the DOCS directory without me manually changing the permissions to 777? or a way to change permissions, copy file, and revert permissions? I've done all types of different things and haven't been able to nail down a solution. If I am missing something from a procedural standpoint, please let me know. Thanks.
--MZ