problem download file with IE 6

This is a discussion on problem download file with IE 6 within the alt.comp.lang.php forums, part of the PHP Programming Forums category; HI all, I have a problem during download file with Internet Explorer 6. I use this script: header('Pragma: public'); ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-02-2007
Obi
 
Posts: n/a
Default problem download file with IE 6

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
Reply With Quote
  #2 (permalink)  
Old 03-02-2007
shimmyshack
 
Posts: n/a
Default Re: problem download file with IE 6

On 2 Mar, 11:38, Obi <sprig...@dbzmail.com> wrote:
> 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



Here's what I have had success with for years:


header("Pragma: no-cache");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Content-Length: ".$download_size);
// We'll be outputting a doc, using the right mimetype is great for
users.
header("Content-type: application/msword");
// It will be called $fname
header("Content-Disposition: attachment; filename=".$fname);

change the mimetype to suit, unless it really is some unidentified
binary file.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:21 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0