本文整理汇总了PHP中RSFormProHelper::readFileChunked方法的典型用法代码示例。如果您正苦于以下问题:PHP RSFormProHelper::readFileChunked方法的具体用法?PHP RSFormProHelper::readFileChunked怎么用?PHP RSFormProHelper::readFileChunked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSFormProHelper
的用法示例。
在下文中一共展示了RSFormProHelper::readFileChunked方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: readFile
public static function readFile($file, $download_name = null)
{
if (empty($download_name)) {
$download_name = basename($file);
}
$fsize = filesize($file);
header("Cache-Control: public, must-revalidate");
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
if (!preg_match('#MSIE#', $_SERVER['HTTP_USER_AGENT'])) {
header("Pragma: no-cache");
}
header("Expires: 0");
header("Content-Description: File Transfer");
header("Expires: Sat, 01 Jan 2000 01:00:00 GMT");
if (preg_match('#Opera#', $_SERVER['HTTP_USER_AGENT'])) {
header("Content-Type: application/octetstream");
} else {
header("Content-Type: application/octet-stream");
}
header("Content-Length: " . (string) $fsize);
header('Content-Disposition: attachment; filename="' . $download_name . '"');
header("Content-Transfer-Encoding: binary\n");
ob_end_flush();
RSFormProHelper::readFileChunked($file);
exit;
}
示例2: readFile
public static function readFile($file, $download_name = null)
{
jimport('joomla.filesystem.file');
$ext = strtolower(JFile::getExt($file));
if ($ext == 'tgz' || $ext == 'gz') {
// Needed when some servers with GZIP compression perform double encoding
if (is_callable('ini_set')) {
if (is_callable('ini_get') && ini_get('zlib.output_compression')) {
ini_set('zlib.output_compression', 'Off');
}
ini_set('output_buffering', 'Off');
ini_set('output_handler', '');
}
header('Content-Encoding: none');
}
if (empty($download_name)) {
$download_name = basename($file);
}
$fsize = filesize($file);
header("Cache-Control: public, must-revalidate");
header('Cache-Control: pre-check=0, post-check=0, max-age=0');
if (!preg_match('#MSIE#', $_SERVER['HTTP_USER_AGENT'])) {
header("Pragma: no-cache");
}
header("Expires: 0");
header("Content-Description: File Transfer");
header("Expires: Sat, 01 Jan 2000 01:00:00 GMT");
if (preg_match('#Opera#', $_SERVER['HTTP_USER_AGENT'])) {
header("Content-Type: application/octetstream");
} else {
header("Content-Type: application/octet-stream");
}
header("Content-Length: " . (string) $fsize);
header('Content-Disposition: attachment; filename="' . $download_name . '"');
header("Content-Transfer-Encoding: binary\n");
ob_end_flush();
RSFormProHelper::readFileChunked($file);
exit;
}