Hi,
I actually had never heard of X-Sendfile until today.
That's a really good idea and easy to implement.
Add the code:
if(function_exists('apache_get_modules')){
$modules = apache_get_modules();
if (is_array($modules) && count($modules) && in_array('mod_xsendfile', $modules)) {
// If mod_xsendfile is loaded, use X-Sendfile to deliver...
header("Expires: 0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="' . $name . '"');
header("Cache-Control: maxage=1");
header("Pragma: public");
header("Content-Transfer-Encoding: binary");
header('X-Sendfile: ' . $filename);
$dispatcher->trigger( 'onAfterDownloadFile', array( &$filename, &$file) );
exit;
}
}
after the code:
$name = (strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) ?
preg_replace('/\./', '%2e', $fileinfo['basename'], substr_count($fileinfo['basename'], '.') - 1) :
$fileinfo['basename'];
in the file administrator/components/com_hikashop/classes/file.php and if you have mod_xsendfile configured on your web server, it will use it to send the files. Please note that this requires that mod_xsendfile is installed and correctly configured to allow the sending of the files from the upload secure folder of HikaShop (default location is media/com_hikashop/upload/safe), otherwise, it will use the normal send process or not send anything.
Please let us know how it goes so that we can add it to next version of HikaShop.