I wish to limit uploading to the video files swf pps bmp pps png gif mpg mp3 and wav - i'm sure I have the file / type incorrect. can someone please give logical solution...
here's my code:
<?php
if ((($_FILES["file"]["type"] == "video/swf")
|| ($_FILES["file"]["type"] == "video/pps")
|| ($_FILES["file"]["type"] == "video/bmp")
|| ($_FILES["file"]["type"] == "video/pps")
|| ($_FILES["file"]["type"] == "video/png")
|| ($_FILES["file"]["type"] == "video/gif")
|| ($_FILES["file"]["type"] == "video/mp3")
|| ($_FILES["file"]["type"] == "video/wav"))
&& ($_FILES["file"]["size"] < 200000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
}
else
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 200000) . " Kb<br />";
echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
if (file_exists("upload/" . $_FILES["file"]["name"]))
{
echo $_FILES["file"]["name"] . " already exists. ";
}
else
{
move_uploaded_file($_FILES["file"]["tmp_name"],
"upload/" . $_FILES["file"]["name"]);
echo "Thank you for your" . "upload/" . $_FILES["file"]["name"];
}
}
}
else
{
echo "Invalid file";
}
?>