Forum Moderators: coopster

Message Too Old, No Replies

PHP force file download

works in mozilla not in IE6

         

Tartan75

12:20 am on Jun 2, 2003 (gmt 0)

10+ Year Member



I am trying to force a wma file to download, using the following code:

header ("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=$filename");
readfile($filenameWithPath);

This works fine in Mozilla, but in internet explorer (6), it produces an error message – appears to be trying to get the php file (with variables).

Any advice much appreciated.

jatar_k

4:55 pm on Jun 2, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



have you read through the comments here
header [php.net]

it looks like there may be some useful comments. One was adding
header("Cache-control: private");

not sure if that will do it.