Answer Posted / rashmi bajpai
On php coding file like uploaded.php<?php
$target_path="../upload/";//this is the name of that folder
in which we r uploading our video.//
$arg=$_FILES['uploadedfile']['tmp_name'];
if(move_uploaded_file($tmp,$target_path))
{
echo "The file". $_FILES['uploadedfile']['name']."has been
uploaded";
}
else
{
echo"there was an error in uploading";
}
?>
On other html file like uploaded.php:
<html>
<form enctype="multipart/form-data" action="uploaded.php"
method="post">//file should always be uploaded by post method.
<input type="hidden" name="MAX_FILE_SIZE" value="100000"/>
Choose a file to upload:
<input name="uploaded file" type="file"/> <br>
<input type="submit" value="upload file"/>
</form>
</html>
| Is This Answer Correct ? | 24 Yes | 3 No |
Post New Answer View All Answers
Why do we use htaccess
How to redirect a page in php?
How do I get csrf token?
How can I prevent sql-injection in php?
What is the difference between array_pop() and array_push()?
Is polymorphism inherited?
What is the difference between echo print and print_r in php?
What is difference between session and cookies in php?
What is ltrim?
What is the difference between characters 34 and x34?
Tell me what kind of things have you done on the social side?
What is compact function php?
What is the alternative structure for control structures?
Write down the code for save an uploaded file in php.
Tell me how to find the length of a string?