New to our community ?

Discover a world of possibilities! Join us and explore a vibrant community where ideas flourish and connections thrive.

One of Our Valued Members

Thank you for being part of our community. Your presence enriches our shared experiences. Let's continue this journey together!

Home Articles Upload a file to the Server using|PHP

Upload a file to the Server using|PHP

Upload a file to the Server using|PHP

welcome back to , in our previous post we learn how to Convert words to numbers in PHP. in this post we will see how to Upload a file to the Server with the help of PHP.
Let’s go through the overview of this program before starting the tutorial. So we will first create a file with the name index.php, in this file we are creating a responsive form by using bootstrap classes and taking a file from user and after submitting the form we will upload it on the server.

Upload a file to the Server


<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href=""><!-- jQuery library -->
<script src=""></script>
<!-- Latest compiled JavaScript -->
<script src=""></script>
<form method="post"   action="index.php" enctype="multipart/form-data">
 Resume : <input type="file" name="f1" class="form-control"> <br>
<input type="submit" value="Upload" class="btn btn-success">

Also Read :
PHP Login Script With Remember me.
Unable to create a directory a wordpress error
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

after submitting the form we will upload this file on the server using below code.

if(is_uploaded_file($_FILES['f1']['tmp_name'])) {  
$fname = $_FILES['f1']['name'];            if(move_uploaded_file($_FILES['f1']['tmp_name'],"uploads/$fname"))
echo "Uploaded successfully";
echo "Not uploaded";