<?php require_once("HTTP/Download.php"); $params = array( "file" => "./download/sample.txt", "contenttype" => "text/plain" ); $download = new HTTP_Download($params); $download -> setContentDisposition(HTTP_DOWNLOAD_ATTACHMENT, "test.txt"); $download -> send(); ?>