WT Practical 10


Practical : 10
Subject : Web Technology

Aim : Write a PHP script to upload a file and display the content of a file on another page and upload those files which have extension .jpg.


Source Code :
//File.php
<?php

if(isset($_POST['btnconform'])){
            if($_FILES["f1"]["type"]=="image/jpeg" ||
            $_FILES["f1"]["type"]=="image/jpg"){
            echo "<br> File Name= ".$_FILES["f1"]["name"];
            echo "<br> File Type= ".$_FILES["f1"]["type"];
            echo "<br> File Size= ".$_FILES["f1"]["size"]."byte";
            }
            else{
            echo "<br> upload only jpeg or jpg Files";
            }
}
?>
<html>
<head><title>pratik008</title></head>
<body>
<form method="post" enctype="multipart/form-data">
file<input type="file" name="f1"/><br>
<input type="submit" name="btnconform" value="Upload"/>
</form>
</body>
</html>

Output :


Pratik Boghani

Author & Editor

Life is all about the next step.

0 comments:

Post a Comment