how we can upload and view video files

Answer Posted / laxmikant

if($_POST['submit'])
{
if($_FILES['video']['error']>0)
{
echo "error in ur file";
}
else
{
$target_path = "uploads/";

echo $target_path = $target_path . $_FILES['video']['name'];

if(move_uploaded_file($_FILES['video']['tmp_name'],
$target_path)) {
echo "The file ". basename( $_FILES['video']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try
again!";
}

}

}
<form name="f" action="" method="post"
enctype="multipart/form-data">
<input type="file" name="video" />
<input type="submit" name="submit" value="submit" />
</form>

Is This Answer Correct ?    7 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between php traits vs interfaces?

489


Why ide is recommended for use while programming with php?

507


Is overloading possible in php?

522


Which function is used to read a file removing the html and php tags in it upwork?

492


What is the role of php.ini file?

549






Tell me how can we pass the variable through the navigation between the pages?

528


Is php outdated 2019?

509


What is the difference between rest and soap?

569


What difference between require() and require_once()?

552


What is the difference between print() and echo()?

581


Which function will you use to create an array?

520


Does php has a future?

493


Write a program in php to reverse a number?

546


What are the uses of explode() function?

559


What are PHP Magic Methods/Functions. List them.

545