By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,831 Members | 2,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,831 IT Pros & Developers. It's quick & easy.

Problem downloading file in IE6

P: n/a
Obi
HI all,

I have a problem during download file with Internet Explorer 6.

I use this script:

header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Content-Type: application/octet-stream');
//header('Content-Type: application/force-download');
header('Content-Disposition: attachment; filename="'.$filename.'"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($dfile));

In same case, this open a dialog box asking if open or save a file
colled 'index.php' and not the correct file name
and the description file is 'php file'

May you help me?

thanks in advance
Fabio
Mar 2 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Obi" posted...
: I have a problem during download file with Internet Explorer 6.

Internet Explorer is a BIG problem. over 90% of the world
uses it.

: I use this script:
:
: header('Pragma: public');
: header('Expires: 0');
: header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
: header('Content-Type: application/octet-stream');
: //header('Content-Type: application/force-download');
: header('Content-Disposition: attachment; filename="'.$filename.'"');
: header('Content-Transfer-Encoding: binary');
: header('Content-Length: ' . filesize($dfile));

Try taking out the // line? Did you check to see which headers
actually get sent to the client?

And are $filename and $dfile the same file?

: This opens a dialog box asking if open or save a file named
: 'index.php' (not the proper file).

echo("filename == " . $filename . "<br />");
echo("dfile == " . $dfile . "<br />");

It sounds like the server is delivering the wrong header for
an index.php file, so perhaps the variable $filename is an
empty string?

--
Jim Carlock
Post replies to the group.
Mar 2 '07 #2

P: n/a
PARDON if this posts twice. Something funny occurs with the
Road Runner/TimeWarner/BrightHouse servers.

"Obi" posted...
: I have a problem during download file with Internet Explorer 6.

Internet Explorer is a BIG problem. over 90% of the world
uses it.

: I use this script:
:
: header('Pragma: public');
: header('Expires: 0');
: header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
: header('Content-Type: application/octet-stream');
: //header('Content-Type: application/force-download');
: header('Content-Disposition: attachment; filename="'.$filename.'"');
: header('Content-Transfer-Encoding: binary');
: header('Content-Length: ' . filesize($dfile));

Try taking out the // line? Did you check to see which headers
actually get sent to the client?

And are $filename and $dfile the same file?

: This opens a dialog box asking if open or save a file named
: 'index.php' (not the proper file).

echo("filename == " . $filename . "<br />");
echo("dfile == " . $dfile . "<br />");

It sounds like the server is delivering the wrong header for
an index.php file, so perhaps the variable $filename is an
empty string?

--
Jim Carlock
Post replies to the group.
Mar 2 '07 #3

P: n/a
Obi
Jim Carlock wrote:
"Obi" posted...
: I have a problem during download file with Internet Explorer 6.

Internet Explorer is a BIG problem. over 90% of the world
uses it.

: I use this script:
:
: header('Pragma: public');
: header('Expires: 0');
: header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
: header('Content-Type: application/octet-stream');
: //header('Content-Type: application/force-download');
: header('Content-Disposition: attachment; filename="'.$filename.'"');
: header('Content-Transfer-Encoding: binary');
: header('Content-Length: ' . filesize($dfile));

Try taking out the // line? Did you check to see which headers
actually get sent to the client?

And are $filename and $dfile the same file?

: This opens a dialog box asking if open or save a file named
: 'index.php' (not the proper file).

echo("filename == " . $filename . "<br />");
echo("dfile == " . $dfile . "<br />");

It sounds like the server is delivering the wrong header for
an index.php file, so perhaps the variable $filename is an
empty string?
$filename is onle the name of file
$dfile is the relative path of file on the server

The big problem is, on my computer the script works fine.
On my customer computers, doesn' t works.

any ideas?
Mar 2 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.