Location: PHPKode > projects > Todo Manager > todo/download.php
<?php
// requires
require_once "config.inc.php";
require_once $_SERVER["DOCUMENT_ROOT"]."/".FOLDER."/library/request.lib.php";
require_once $_SERVER["DOCUMENT_ROOT"]."/".FOLDER."/library/file.lib.php";

// parameters
$filename = request_get("filename");

// variables
$path = file_concat($_SERVER["DOCUMENT_ROOT"], FOLDER, $filename);
$pathinfo = pathinfo($path);
$basename = $pathinfo["basename"];

// force download
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=\"".$basename."\"");
header("Content-Length: ".filesize($path));

readfile($path);
?>
Return current item: Todo Manager