I am trying to write a page which allows me up upload files to my server. As far as I can tell the file is being uploaded (file_exists($_FILES['userfile']['tmp_name']) returns true), but when I try to move it to my directory using move_uploaded_file, I get the following errors:
Warning: move_uploaded_file(/usr/local/data1/users/46217/myfile.jpg) [function.move-uploaded-file]: failed to create stream: Permission denied in /usr/local/data1/users/46217/uploader.php on line 110
Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/php5GCahx' to '/usr/local/data1/users/46217/myfile.jpg' in /usr/local/data1/users/46217/uploader.php on line 110
where line 110 is:
if (move_uploaded_file($FILES['userfile']['tmp_name'], "/usr/local/data1/users/46217/" . $FILES['userfile']['name'])) {
Is there some permission I need that I do not have? The script is being run from the same directory that I'm trying to write to and I have all permissions on that directory. I've tried using copy instead of move_uploaded_file and got the same error.
I'm on an apache server with php version 4.3.1
Any help would be greatly appreciated.