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 are the uses of implode() function?
What is the difference between Session and Cookie?
How are cookies created?
Explain about the data types in PHP?
When are you supposed to use endif to end the conditional statement?
What is session and why do we use it?
How to get the length of string?
Is null check in php?
Tell me what is needed to be able to use image function?
Can we use onclick in submit button?
What type of comments are supported by PHP.
What is use of htmlspecialchars php?
Is PHP an open source software?
How can we enable error reporting in php?
What is meant by MIME?