Download
    Interview Question     &Answer
Main Menu
PHP File Upload@ Shwetank education.com
Script   File_upload.php
HTML code
<form action="#" method="post" enctype="multipart/form-data">
Upload Files:
<input type="file" name="up" id="up">

<input type="submit" name="btn" value="Upload File">
</form>


PHP script
<?
if (isset($_POST['btn']))
{
$uploaddir='uploads/';// web root dir name
$uploadfile=$uploaddir.basename($_FILES['up']['name']);
if (move_uploaded_file($_FILES['up']['tmp_name'],$uploadfile))
{
echo"file is valid ! and sucessfully upload";
}
else
{
echo"not upload ! some error";
}
}
?>

Output :
Upload Files:   

Notes*
Create folder name uploads in project folder root.
copy html and php script in page name-file_upload.php

IT  Projects Links
M-Tech Thesis
Php Project
Java Project
Asp.Net Project
Android Project
Vb .Net Project
Html Project

------------------------------- Electronics  Project
Networking
Embedded system
Telecom
Robotics
CCNA
------------------------------- Latest IT  News


Copyright 2010-2015    shwetankeducation.com
Privacy & Terms