HTML のヘッダーについてはわかりませんが、ここでの基本的な考え方は、ヘッダーを変更し、ユーザーがダウンロードするファイルを追跡することです。
リンク (必要なもの、関数にリンクできるもの、または l() を使用するもの) は、特定の関数の実行につながります。その関数内で、php 関数 header() を呼び出して、drupal が何かを行う前に適切なヘッダーをブラウザーに返し、次にユーザーにダウンロードさせたいファイルを返します。その後、die() 関数を呼び出して実行を終了します。
ブラウザには、ファイルのダウンロードが開始されます。しかし、header() 関数に入れる必要があるものについては、よくわかりません。これについてさらに検索することもできます。
更新: ユーザーがダウンロードする Excel で読み取り可能なファイルを提供するために使用したコードは次のとおりです。
function download_as_excel($header, $rows, $filename = 'result.xls',$pre_content = "",$post_content = "")
{
//Export the table to MS Excel.
header('Content-type: application/vnd.ms-excel; charset=UTF-8');
header('Content-Disposition: attachment; filename="'.$filename.'"');
$output = '<html>';
$output .= '<head><meta http-equiv=Content-Type content="text/html; charset=utf-8"></head>';
$output .= '<body>';
$output .= $pre_content;
$output .= theme('table', array('header' => $header, 'rows' => $rows));
$output .= $post_content;
$output .= "</body></html>";
print $output;
exit;
}