<?php
class QT_Download {

function download_file($dir,$file) {
	$path = $dir.'/'.$file;
	if(file_exists($path)) {
		require_once 'HTTP/Download.php';
		$dl = new HTTP_Download();
		$dl->setFile($path);
		$dl->setContentDisposition(HTTP_DOWNLOAD_ATTACHMENT,$file);
		$dl->setBufferSize(2097152);
		$dl->setCache(FALSE);
		$dl->send();
	}
}

function download_text_data($data,$file_name) {
	require_once 'Quicty/phplib/HTTP/Download.php';
	$dl = new HTTP_Download();
	$dl->setContentType('plain/text');
	$dl->setContentDisposition(HTTP_DOWNLOAD_ATTACHMENT,$file_name);
	$dl->setBufferSize(2097152);
	$dl->setCache(FALSE);
	$dl->setData($data);
	$dl->send();
}


} // end of class QT_Download

?>
