File upload in UNIX
Posted: Tue Oct 21, 2003 11:56 pm
I have a file upload script which i have tested in Windows. I now need to move it to my UNIX server but i am having problems with this. Here is the relevant section of the code.
I keep getting the error message
Code: Select all
//absolute path on UNIX
$uploaddir = "uploads/";
//full path on Windows 5.1
//$uploaddir = 'c:\\Program Files\\Apache Group\\Apache2\\htdocs\'';
$upfile = $uploaddir. $_FILES['userfile']['name'];
if (!file_exists($uploaddir)){
echo "upload folder does not exists";
exit;
}
if (!move_uploaded_file($_FILES['userfile']['tmp_name'], $upfile)) {
echo "Problem: Could not move file into directory ";
exit;
}I keep getting the error message
I definitely have a directory called 'uploads' under my cgi-bin directory. Any sugestion will be appreciated.Warning:Unable to access uploads/test.xml in /users/cam/sbscs/myusername/.public_html/cgi-bin/myphpfile.php4 on line 54
Problem: Could not move file into directory