6
Contributors
6
Replies
60
Views
6 Years
Discussion Span
Last Post by pritaeas
1
//This is the code for  video uploading you will make a folder of videos and save your videos there and if you want to save your videos in database you just have to save its name like i have done 
<?php
if (isset($_REQUEST['upload']))
{
$name=$_FILES['uploadvideo']['name'];
 $type=$_FILES['uploadvideo']['type'];
//$size=$_FILES['uploadvideo']['size'];
$cname=str_replace(" ","_",$name);
$tmp_name=$_FILES['uploadvideo']['tmp_name'];
$target_path="video/";
$target_path=$target_path.basename($cname);
if(move_uploaded_file($_FILES['uploadvideo']['tmp_name'],$target_path))
{
echo $sql="INSERT INTO tbl_video(name,type) VALUE('".$cname."','".$type."')"; 
$result=mysql_query($sql);
echo "Your video ".$cname." has been successfully uploaded";
}
}

?>
<form name="video" enctype="multipart/form-data" method="post" action="">
<input name="MAX_FILE_SIZE" value="100000000000000"  type="hidden"/>
<input type="file" name="uploadvideo" />
<input type="submit" name="upload" value="SUBMIT" />
</form>

Edited by Ezzaral: Added code tags. Please use them to format any code that you post.

Votes + Comments
useful post
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.