PHP script to download file not working in IE

后端 未结 5 639
暗喜
暗喜 2020-12-08 11:53

I have a script that takes a key from $_GET[\'key\'] , looks up the location in a database and uses the readfile together with some headers to present a download for the use

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 12:46

    Replace this:
    header("Content-type: application/octet-stream");
    with this:
    header("Content-Type: application/force-download");

    According to this post, IE doesn't normally listen to your headers, and instead looks for itself what you are sending.

提交回复
热议问题