Hi all,
I've been digging around on the newsgroups and the web for a possible
answer for this problem, but have so far come up with nothing so
thought I would ask here...
I have the following code doing a file upload...
$upload_result =
move_uploaded_f ile ( $_FILES['userfile']['tmp_name'],$dest_filename );
$chmod_result = chmod ($dest_filename , 0777);
The destination folder is set to permission 777, and the code above
reports success. Looking through an FTP client or SSH client I can
confirm that the file is there, and it's permission has been set to
777.
However... when I go to a browser and try to look at the file, the
browser reports;
Forbidden
You don't have permission to access /uploads/19.jpg on this server.
This doesn't make sense because I can see manually uploaded files in
that folder. Also (by luck) I also discovered that if I try to chmod
the uploaded file, I get the following error;
550 Could not change perms on [filename] : Bad file descriptor
I thought "aha - perhaps the file is corrupt", so downloaded it back
to my machine via FTP, and it appears to be fine so it's not that.
I also checked the hierarchy of folders (because the uploads folder is
within another folder), and confirmed that all the folders have
permission 777.
Does anybody have any idea whats going on?
I've been digging around on the newsgroups and the web for a possible
answer for this problem, but have so far come up with nothing so
thought I would ask here...
I have the following code doing a file upload...
$upload_result =
move_uploaded_f ile ( $_FILES['userfile']['tmp_name'],$dest_filename );
$chmod_result = chmod ($dest_filename , 0777);
The destination folder is set to permission 777, and the code above
reports success. Looking through an FTP client or SSH client I can
confirm that the file is there, and it's permission has been set to
777.
However... when I go to a browser and try to look at the file, the
browser reports;
Forbidden
You don't have permission to access /uploads/19.jpg on this server.
This doesn't make sense because I can see manually uploaded files in
that folder. Also (by luck) I also discovered that if I try to chmod
the uploaded file, I get the following error;
550 Could not change perms on [filename] : Bad file descriptor
I thought "aha - perhaps the file is corrupt", so downloaded it back
to my machine via FTP, and it appears to be fine so it's not that.
I also checked the hierarchy of folders (because the uploads folder is
within another folder), and confirmed that all the folders have
permission 777.
Does anybody have any idea whats going on?
Comment