How to create download link in php?

    You can create download link in many ways one of the way is as below:
    Create a file download.php like below
    // The file path where the file exists
    $filepath = "".$_GET['filename']."";
    header("Pragma: public");
    header("Expires: 0");
    header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
    //setting content type of page
    header("Content-Type: application/force-download");
    header("Content-Disposition: attachment; filename=".basename($filepath ));
    header("Content-Description: File Transfer");
    //Read File it will start downloading
    Use following link to download
    <a href="">Download</a>
    Average: 5 (1 vote)