Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to upload restricted image in PHP ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 114
    Comment on it

    Hi Reader's,
    Welcome to FindNerd, today we are going to discuss How to upload restrict file in PHP ?
    If you want upload only jpg, gif image and other type of images not allow to upload

    then, you have to use bellow php code:

    <?php
    //here define which file you want allow
    $image_Type = array("image/jpg", "image/gif", "image/png");
    // check availbility
    if($image_Type != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "gif" )
     {
        echo "Sorry! only JPG,  PNG & GIF files are allowed try again.";
    
        $Uploadok = 0;
    
    }
    
    ?>
    

    output will come following of above example Sorry! only JPG, PNG & GIF files are allowed try again.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: