Created
May 25, 2017 07:38
-
-
Save sudarshanReddykurri/9698af55a2734318155d4b6653fb59a3 to your computer and use it in GitHub Desktop.
PHP FIle Upload
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="testfile.php" method="post" enctype="multipart/form-data" name="form1"> | |
<input type="file" name="upload_file" id="resume"> | |
<input type="submit" name="SubmitBtn" id="SubmitBtn" value="UPLOAD"> | |
</form> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if(isset($_POST["SubmitBtn"])){ | |
if($_FILES["upload_file"]["error"]){ | |
echo "File Could Not be Uploaded"; | |
}else{ | |
move_uploaded_file($_FILES["upload_file"]["tmp_name"],"testUpload/".$_FILES["upload_file"]["name"]); | |
echo " File Uploaded Successfully"; | |
header("refresh:2; url=file.html"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment