piperpowell
05-28-2007, 08:48 AM
Total noob here, please be kind.
I am trying to script an file upload form without success.
move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],
"/piperp86/public_html/useruploads/{$_FILES['uploadFile'] ['name']}");
echo "File uploaded.";
if($_FILES['uploadFile'] ['error'] > 0)
{
switch ($_FILES['uploadFile'] ['error'])
{
case 1: echo 'File exceeded maximum server upload size';
break;
case 2: echo 'File exceeded maximum file size';
break;
case 3: echo 'File only partially uploaded';
break;
case 4: echo 'No file uploaded';
break;
}
}
else
{
echo 'File successfully uploaded';
}
}
?>
<form enctype="multipart/form-data" action="upload.php" method="post">
Select File: <input type="file" name="uploadFile"/>
<input type="hidden" name="MAX_FILE_SIZE" value="1000000"/>
<input name="SubmitB" type="submit" value="Upload File"/>
</form>
The error I get is:
Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid/gid is 32979/32982 is not allowed to access / owned by uid/gid 0/0 in /home/piperp86/public_html/upload.php on line 9
File uploaded.File successfully uploaded
The folder useruploads has write privileges.
My web is hosted by ehostpros. Could it be that they don't allow uploads from web pages? The file is not uploaded.
thanks for reading.
piper
I am trying to script an file upload form without success.
move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],
"/piperp86/public_html/useruploads/{$_FILES['uploadFile'] ['name']}");
echo "File uploaded.";
if($_FILES['uploadFile'] ['error'] > 0)
{
switch ($_FILES['uploadFile'] ['error'])
{
case 1: echo 'File exceeded maximum server upload size';
break;
case 2: echo 'File exceeded maximum file size';
break;
case 3: echo 'File only partially uploaded';
break;
case 4: echo 'No file uploaded';
break;
}
}
else
{
echo 'File successfully uploaded';
}
}
?>
<form enctype="multipart/form-data" action="upload.php" method="post">
Select File: <input type="file" name="uploadFile"/>
<input type="hidden" name="MAX_FILE_SIZE" value="1000000"/>
<input name="SubmitB" type="submit" value="Upload File"/>
</form>
The error I get is:
Warning: move_uploaded_file(): SAFE MODE Restriction in effect. The script whose uid/gid is 32979/32982 is not allowed to access / owned by uid/gid 0/0 in /home/piperp86/public_html/upload.php on line 9
File uploaded.File successfully uploaded
The folder useruploads has write privileges.
My web is hosted by ehostpros. Could it be that they don't allow uploads from web pages? The file is not uploaded.
thanks for reading.
piper