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
What is the difference between php traits vs interfaces?
Why ide is recommended for use while programming with php?
Is overloading possible in php?
Which function is used to read a file removing the html and php tags in it upwork?
What is the role of php.ini file?
Tell me how can we pass the variable through the navigation between the pages?
Is php outdated 2019?
What is the difference between rest and soap?
What difference between require() and require_once()?
What is the difference between print() and echo()?
Which function will you use to create an array?
Does php has a future?
Write a program in php to reverse a number?
What are the uses of explode() function?
What are PHP Magic Methods/Functions. List them.