|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #12715 IE download file twice when serve from DB.
Submitted: 2001-08-13 09:53 UTC Modified: 2001-08-15 04:07 UTC
From: miki at canaan dot co dot il Assigned:
Status: Not a bug Package: Output Control
PHP Version: 4.0.6 OS: Linux
Private report: No CVE-ID: None
 [2001-08-13 09:53 UTC] miki at canaan dot co dot il
When I download file stored on DB using IE, Its take me double the time then Netscape takes.

I discovered that IE download the file twice.
one when the headers are read and latter when the file is requested again.

here is the code:

$query =  "select * from files where issue_id='$id'";
$result = mysql_query ($query)
 or die ("Invalid query");

 $data = @MYSQL_RESULT($result,0, "file_data");
 $type = @MYSQL_RESULT($result,0, "file_type");
 $file_name = @MYSQL_RESULT($result,0, "file_name");
 $file_size = @MYSQL_RESULT($result,0, "file_size");

 // # To force save file
 //header("Content-disposition: attachment; filename=\"$file_name\"");

 Header("Content-type: $type");
 header("Content-Length: $file_size");
 header("Content-Disposition: filename=$file_name");

 echo $data;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-08-13 10:23 UTC]
Not a bug. Ask further support questions on the appropriate
mailing list:

 [2001-08-15 04:07 UTC] miki at canaan dot co dot il
found a way around, but I had to drop:
header("Content-Disposition: filename=$file_name");

when ever Content-Disposition found in the code IE load  the page twice.

Or no one know the answer ( with Content-Disposition ) or its a bug.

Any way I think the solution need to apear on the manual to avoid lots of site that double the dl time.
 [2004-07-28 14:26 UTC] cgursan at hotmail dot com
When you drop the content disposition it prompts for download of the php file. And also Opera works fine with it. But in IE I can't find the solution does anyone know?
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 07:01:31 2024 UTC