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 overriding in php?
What is php destruct?
How can I embed a java program in php file and what changes have to be done in php.ini file?
What is varchar mysql?
What is explode() in php?
What are magic methods?
What are the string functions in php?
What are the advantages of object-oriented programming in php?
Write the statements that are used to connect php with mysql
What is mysqli php?
What is pdo in php why use?
What are the different tables(engine) present in mysql, which one is default?
Tell me how to get the value of current session id?
What is class extend in php?
In PHP, fgets() is used to read a file one line at a time. State Whether True or False?