Program to Upload a file to the Server.
✡️ form1.php
<html>
<head>
</head>
<body>
<form method="post" action="upload.php" enctype="multipart/ form-data">
Resume : <input type="file" name="f1"> <br>
<input type="submit" value="Upload">
</form>
</body>
</html>
✡️ Upload.php
<?php
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";
}
else
{
echo "Not uploaded";
}
}
?>
✡️ form1.php
<html>
<head>
</head>
<body>
<form method="post" action="upload.php" enctype="multipart/ form-data">
Resume : <input type="file" name="f1"> <br>
<input type="submit" value="Upload">
</form>
</body>
</html>
✡️ Upload.php
<?php
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";
}
else
{
echo "Not uploaded";
}
}
?>
Comments
Post a Comment