1
哪些頭文件對於強制下載和哪些頭文件被瀏覽器自動填充最重要php force下載頭文件
例如,
header('Content-Description: File Transfer');
header('Content-type: application/zip');
header('Content-Length: '.sprintf("%u", filesize($zip_out)));
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Pragma: public');
header('Content-Disposition: attachment; filename="'.basename($zip_out).'"');
我省略了第1行和第2行以外的所有標題,下載工作正常,爲什麼/如何?