0
這裏是我的代碼上傳視頻,但視頻既不去文件夾也不去數據庫。但在相同的視頻文件字段,如果你上傳的圖像或音頻,它的工作,我也設置upload_max_filesize
在php.ini 500M。任何人都可以提前表示感謝。視頻不上傳到mysql數據庫。視頻圖像和音頻插入在相同的視頻文件字段
這是我用來上傳視頻的代碼。
<?php
mysql_connect("localhost","root","");
mysql_select_db("test");
if(isset($_POST['submit']))
{
$id=$_POST['id'];
$video=$_FILES['vid']['name'];
$type=$_FILES['vid']['type'];
$size=$_FILES['vid']['size'];
$tempname=$_FILES['vid']['tmp_name'];
$dir="uploadvideo/".$video;
move_uploaded_file($tempname,"$dir");
$insert=mysql_query("insert into myblog(`video`) values ('$video')")or die(mysql_error());
if($insert)
{
echo "<script>alert('Inserted Succesful')</script>";
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="" method="post" enctype="multipart/form-data">
<label for="file" class="tbl">Filename:</label>
<input type="file" name="vid" id="file"><br>
<input type="submit" name="submit" value="Submit">
</form>
</body>
</html>
謝謝@ Damon.s它只能增加的post_max_size。 – 2014-10-22 06:19:04
你還不能上傳你的視頻? – talkhabi 2014-10-22 06:22:31
是的,它現在可以上傳所有類型的視頻。 @ Damon.s – 2014-10-22 06:24:18