我正在尝试在 php 中上传视频文件。但 .avi,mpg,mp4 工作正常,其余部分未上传。
<?php
include '../includes/include.php';
$title = $_POST['txtTitlen'];
$description = $_POST['txtDescriptionn'];
$product = $_POST['selProductn'];
$speciality = $_POST['selSpecialityn'];
$type = $_POST['selMedTypen'];
$temp_img = $_FILES["file"]["tmp_name"];
$date = date("Y-m-d H:i:s", time());
$img=$_FILES["file"]["name"];
if (($_FILES["file"]["type"] == "video/avg") || ($_FILES["file"]["type"] == "video/dat") || ($_FILES["file"]["type"] == "video/mp4") || ($_FILES["file"]["type"] == "video/avi")|| ($_FILES["file"]["type"] == "video/mov") || ($_FILES["file"]["type"] == "video/avi") || ($_FILES["file"]["type"] == "video/wmv") || ($_FILES["file"]["type"] == "video/mkv") || ($_FILES["file"]["type"] == "video/wmx")|| ($_FILES["file"]["type"] == "video/mpeg")|| ($_FILES["file"]["type"] == "video/mpg") && ($_FILES["file"]["size"] < 150000))
{
echo move_uploaded_file($temp_img, "video/$img");
}
else
{
echo "File Loading Error...";
}
$sql="INSERT INTO tblmedia(medTitle,medDesc,medType,medSpeciality,medProduct,medIsActive,insDate,modDate,medPath) VALUES('".$title."','".$description."','".$type."','".$speciality."','".$product."','0','".$date."','".$date."','".$img."');";
mysql_query($sql) or die(mysql_error());
header('Location:../media/');
?>