Your IP : 216.73.216.41


Current Path : /home/purehotels/public_html/components/com_easyfolderlistingpro/views/download/tmpl/
Upload File :
Current File : /home/purehotels/public_html/components/com_easyfolderlistingpro/views/download/tmpl/default.php

<?php
/**
* @version		3.1
* @author		Michael A. Gilkes (michael@valorapps.com)
* @copyright	Michael Albert Gilkes
* @license		GNU/GPLv3

Easy Folder Listing Pro Component for Joomla!
Copyright (C) 2012-2016 Michael Albert Gilkes (Valor Apps)

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

//being caustious. remove any previous data in print buffer.
ob_end_clean();

if (empty($this->abspath) || empty($this->filename))
{
	exit(0); /* Can't download a non-existent file. Bye */
}

/* Get the extension, file size, and last modified date */
if (stripos(EFLPListing::INVALID_EXTS, $this->extension) !== false)
{
	exit(0); /* Can't download php or html files. Bye */
}

$mime = '';
switch ($this->extension)
{
	case 'pdf': $mime = 'application/pdf'; break;
	case 'exe': $mime = 'application/octet-stream'; break;
	case 'zip': $mime = 'application/zip'; break;
	case 'doc': $mime = 'application/msword'; break;
	case 'xls': $mime = 'application/vnd.ms-excel'; break;
	case 'ppt': $mime = 'application/vnd.ms-powerpoint'; break;
	case 'gif': $mime = 'image/gif'; break;
	case 'png': $mime = 'image/png'; break;
	case 'jpeg':
	case 'jpg': $mime = 'image/jpg'; break;
	default: $mime = 'application/force-download';
}
$filesize = @filesize($this->abspath);
$filetime = @filemtime($this->abspath);

if(ini_get('zlib.output_compression'))
{
	ini_set('zlib.output_compression', 'Off'); // required for IE, otherwise Content-disposition is ignored
}

if(function_exists('apache_setenv'))
{
	apache_setenv('no-gzip', '1'); //fix for IE7/8
}

header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
if ($filetime)
{
header('Last-Modified: '.gmdate('D, d M Y H:i:s', $filetime).' GMT');
}
header('Cache-Control: private',false);
header("Content-Description: File Transfer");
header("Content-Type: ".$mime);
header("Content-Transfer-Encoding: binary");
header('Content-Disposition: '.$this->attachment.'; filename="'.$this->filename.'.'.$this->extension.'";');
header("Content-Length: ".$filesize);
header('Connection: close');

if(!ini_get('safe_mode'))
{
	@set_time_limit(0);
}
ValorUtilities::readfile_chunked($this->abspath);
exit(0);