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
Is it possible to destroy a cookie?
How to access standard error stream in PHP?
How to create reusable code in php?
Write a program to find a string is palindrome or not?
Why does php start with variables?
Name some of the constants in php and their purpose.
How to execute an sql query? How to fetch its result?
What is the difference between php and java?
Tell me will a comparison of an integer 12 and a string "13" work in php?
How do you connet mysql database with php?
What are the different errors in php?
What is the importance of "method" attribute in a html form?
What is difference between put and post method in http?
Why should I learn php?
How is it possible to propagate a session id?