I have this PHP code:
-----------------------
if(isset($_POST['submit']) && $_POST['submit'] == 'Submit') //if form has been submitted
{
//for now:
if ($_FILES["file"]["error"] > 0)
{
//echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
if ((($_FILES["file"]["type"] == "video/x-msvideo") //.avi
|| ($_FILES["file"]["type"] == "video/quicktime") //quicktime
|| ($_FILES["file"]["type"] == "video/x-ms-asf")
|| ($_FILES["file"]["type"] == "video/mp4")
|| ($_FILES["file"]["type"] == "audio/x-ms-wmv")
|| ($_FILES["file"]["type"] == "video/x-ms-wmv")
|| ($_FILES["file"]["type"] == "video/mpeg"))
&& ($_FILES["file"]["size"] < 10000000))
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
if (move_uploaded_file($_FILES["file"]["tmp_name"],"/tmp/".$_FILES["file"]["name"])) {
echo "file moved";
include "putfile.php";
} else {
echo "move failed";
}
} else {
echo "wrong type of file please try again....";
}
}
-------------------------
the code works pretty well, except it wont allow uploads of .avi, .qt, .mov. Which it clearly says is allowable based on the above MIME type. This is driving me nuts.