Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to make download a file strictly in PHP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 299
    Comment on it

    On the execution of exe file you must need the property of header like Description, Type and Disposition For making the strict/force download of a file in PHP you have to use the code below:-

     <?php
        $FileName = "http://abc.com/example.exe"; 
    
        header("Content-Description: File Transfer"); 
        header("Content-Type: application/octet-stream"); 
        header("Content-Disposition: attachment; filename=\"$FileName\""); 
    
        readfile ($FileName); 
        ?>
    

 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: