Forum Moderators: coopster
header("Content-Type: application/octet-stream");
header("Content-Type: application/force-download");
header("Content-Disposition: attachment; filename=$name");
header("Content-Transfer-Encoding: text");
........
however, when i use this link:
<a href="download.php?id=123" target="_blank">download</a>
in IE:
clicking the link will open a new blank window
if i save it, start&end download, the window will not close
how to solve this peoblem
if not, a new window won't open.
and why so many headers? i know, there were a lot of problems time ago, but they might all solved now. there is a strict definition in http 1.1 which says that one header is enough:
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=$name");
the second one is to tell the filename. that's all. it makes no sense to set the Content-Type 2 times. the first one will be overwritten (by php) and that's good.