I know this has been discussed recently. And I've read through and tried things I've gleaned from those posts. Yet...my uploads still don't work.
I rebuilt apache last night (at my hosting service's suggestion)...and this morning I am finally getting:
Warning: move_uploaded_file(Warning: move_uploaded_file(/home/gwcom/public_html/psb/psb_uploads/trynewmike.jpg): failed to open stream: Permission denied in /home/gwcom/public_html/psb/psb_script/upload.php3 on line 57)line 57
Warning: move_uploaded_file(): Unable to move '/tmp/phpW5qwaB' to '/home/gwcom/public_html/psb/psb_uploads/trynewmike.jpg' in /home/gwcom/public_html/psb/psb_script/upload.php3 on line 57
The directory (psb_uploads) , at the moment, has a 777 security level.
Prior to these errors I was getting nothing back at all...it just simply didn't work.
I am not all that new to using php, yet this one has me baffled. (I am kind of new to *nix and am on a server which uses a RedHat implementation.
I'd appreciate if any of you who have solved this problem in the past might point me in the right direction. I'm certain it's something silly I am missing...but I sure can't see it!
Thanks,
Jeff Mills
also...In case it helps, I include some of my code below.
The form is:
<form action='upload.php3' method="post" name="fileupload" enctype="multipart/form-data">
The input is:
<input type="file" name="file2use" size="32">
After pressing submit...among other bits of code which verify the user, etc. I use the following to load a couple of variables:
$tmp_file_name = $FILES[file2use][tmp_name];
$pic_file_name = $FILES[file2use][name];
$pic_file_name = strtolower($pic_file_name);
Then I use the following to move the file to usable space (this is the line 57 mentioned above in the error messages):
move_uploaded_file($tmp_file_name, $pic_path.$pic_file_name);
Followed by this line to display the image info and image itself.
echo $tmp_file_name."<BR>".$pic_file_name.'<BR>
<img src="'.$pic_path.$pic_file_name.'"><BR>';