•How to upload files using PHP?

Answer Posted / kapil dhiman

<?php

move_uploaded_file($_FILES['file']['tmp_name'],"images/".$_FILES['file']['name']);

?>
<form action="" method="post" enctype="multipart/form-data">
File<input type="file" name="file" /><input type="submit" name="sub" value="Upload" />
</form>

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to write a program to make chess?

770


What is regex in html?

715


How to open standard output as a file handle?

763


Explain how to submit form without a submit button.

742


What is the difference between require and include in php?

758


Why php is sometimes called as embedded scripting language?

722


Is a number php?

753


How to know user has read the email-php?

727


Name some of the popular frameworks in php.

750


How to calculate the difference between two dates using php?

768


What is form action php?

785


Can I learn laravel without php?

777


How does php session work?

721


What is cookie and session in php?

706


How come the code works, but doesn’t for two-dimensional array of mine?

810