download.php 967 Bytes
Newer Older
imac's avatar
imac committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
<?php

class PMXI_Download
{		
	
	static public function zip($file_name)
	{
		
		header('Content-type: application/zip');
		header("Content-Disposition: attachment; filename=\"".basename($file_name)."\"");
		readfile($file_name);
		die;
	}

	static public function xls($file_name)
	{
		header("Content-Type: application/vnd.ms-excel; charset=UTF-8");
        header("Content-Disposition: attachment; filename=\"".basename($file_name)."\"");
        readfile($file_name);
        die;
	}

	static public function csv($file_name)
	{
		header("Content-Type: text/plain; charset=UTF-8");
        header("Content-Disposition: attachment; filename=\"".basename($file_name)."\"");
        readfile($file_name);
        die;
	}

	static public function xml($file_name)
	{
		header("Content-Type: application/xhtml+xml; charset=UTF-8");
        header("Content-Disposition: attachment; filename=\"".basename($file_name)."\"");
        readfile($file_name);
        die;
	}	

}