| Current Path : /home/purehotels/public_html/components/com_easyfolderlistingpro/views/archive/tmpl/ |
| Current File : /home/purehotels/public_html/components/com_easyfolderlistingpro/views/archive/tmpl/default.php |
<?php
/**
* @version 3.2.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');
ob_end_clean();
if (empty($this->filename) || empty($this->filepath) || empty($this->extension))
{
exit(0); /* Can't download a non-existent file. Bye */
}
if (stripos('zip,gz,bz2', $this->extension) === false)
{
exit(0); /* Can't download anything but archive files. Bye */
}
if (stripos('.asp,aspx,.php,.htm,html', substr($this->filename, -4)) !== false)
{
exit(0); /* Can't fool this guy here. Bye */
}
$mime = '';
switch ($this->extension)
{
case 'gz': $mime = 'application/x-gzip'; break;
case 'bz2': $mime = 'application/x-bzip2'; break;
case 'zip': $mime = 'application/zip'; break;
default: $mime = 'application/force-download';
}
$filesize = @filesize($this->filepath.$this->filename);
$filetime = @filemtime($this->filepath.$this->filename);
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: attachment; filename="'.$this->filename.'";');
header("Content-Length: ".$filesize);
header('Connection: close');
if(!ini_get('safe_mode'))
{
@set_time_limit(0);
}
ValorUtilities::readfile_chunked($this->filepath.$this->filename);
exit(0);