Forum Moderators: coopster

Message Too Old, No Replies

How prevent IE from adding [1] to name of a file passed by readfile()?

Passing files via a php script

         

John Carpenter

12:37 pm on Feb 4, 2006 (gmt 0)

10+ Year Member



I'm using the following code example from php.net to pass a binary file via a php script:

 header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private",false);
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"".basename($filename)."\";");
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".@filesize($filename));
set_time_limit(0);
@readfile("$filename") or die("File not found.");

$filename is set for example to /name-2.0.cgm

In Firefox the "Save As" dialog correctly suggests this name. But IE6 suggests the following name: name-2[1].0.cgm

Anyone knows how I can prevent IE from adding the [1]?

coopster

6:44 pm on Feb 8, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



MSIE ignores RFC2616. Here is a relative thread that may help:

[webmasterworld.com...]

coopster

9:30 pm on Feb 8, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Here are two other docs from MS. Note, this first doc does not explain how it violates the RFC mentioned earlier. You would think they might mention such a blatant violation ;)

[msdn.microsoft.com...]
[microsoft.com...]