For the life of me, I cant get my app to only accept these file types: .txt .bsp .wad .rad
PLEASE HELP...I have to have this live by MONDAY AAARRRG!
Jeeps.
Here is what I have:
<FORM enctype="multipart/form-data" action="<?echo $PHP_SELF?>" method="post">
<INPUT TYPE="HIDDEN" NAME="MAX_FILE_SIZE" VALUE="4000000">
Upload Map: <INPUT NAME="userfile" type="file">
<INPUT TYPE="SUBMIT" NAME=submit VALUE="Send File">
</FORM>
<?
} else {
if ($userfile=="none")
{
echo "Problem: no file uploaded";
exit;
}
if ($userfile_size==0)
{
echo "Problem: uploaded file has zero size";
exit;
}
if (!is_uploaded_file($userfile))
{
echo "Problem: nice try, but file must originate on your machine!";
exit;
}
$upfile ="$uploaddir/".$userfile_name;
if ( !copy($userfile, $upfile))
{
echo "Problem: Could not move file into that directory";
exit;
}