Upload file permissions issue
Posted: Sat Mar 22, 2008 3:42 am
Hi, I am trying to write a page that simply uploads images to my server through a web browser. The place I found the code is on php.net here: http://us2.php.net/features.file-upload
The code there seems straight forward, but I can't get it to work. The issue occurs on this line in my code:
@move_uploaded_file($_FILES[$fieldname]['tmp_name'], $upload_filename)
or error('receiving directory insuffiecient permission', $upload_form);
Obviously, ther is a permission issue on the server, as the error portion of my script outputs "receiving directory insuffiecient permission".
I have changed a few things on the Linux server, for example I followed a recommendation on from the link above that said to chown nobody upload_dir. That didn't work. I also changed the permission of the uploaded_images directory to 0777 temporarily, and that didn't help. Just trying to debug this script but I don't know what the next step. Any help? Thanks.
The code there seems straight forward, but I can't get it to work. The issue occurs on this line in my code:
@move_uploaded_file($_FILES[$fieldname]['tmp_name'], $upload_filename)
or error('receiving directory insuffiecient permission', $upload_form);
Obviously, ther is a permission issue on the server, as the error portion of my script outputs "receiving directory insuffiecient permission".
I have changed a few things on the Linux server, for example I followed a recommendation on from the link above that said to chown nobody upload_dir. That didn't work. I also changed the permission of the uploaded_images directory to 0777 temporarily, and that didn't help. Just trying to debug this script but I don't know what the next step. Any help? Thanks.