記録のために:JoomlaのMVC構造内では実行できません.charset(および他のヘッダー)が常に添付されているため、別のphpファイルからJoomlaのフレームワークをインポートして初期化することになりました。
define( '_JEXEC', 1 );
// real path depending on the type of server
// change the number of returns/level needed in your path relative to the position of your script in your directory
define( 'JPATH_BASE', realpath(dirname(__FILE__).'/../../..' ));
define( 'JPATH_COMPONENT', realpath(dirname(__FILE__).'/..' ));
define( 'DS', DIRECTORY_SEPARATOR );
// loading framework of Joomla!
require_once ( JPATH_BASE.DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE.DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
/*
... some other joomla stuff ...
*/
header('Content-Disposition: attachment; filename="example.zip"'));
header('Content-Type: application/octet-stream');
readfile($lfile);
したがって、基本的には、フレームワークをロードし、データベースなどを使用して、独自にヘッダー関数を呼び出します。願っています、これは他の誰かを助けます。