Bug #12715 Updated: IE download file twice when serve from DB.
| From: | sniper@php.net | Date: | Mon, 13 Aug 2001 14:23:41 +0000 |
| Subject: | Bug #12715 Updated: IE download file twice when serve from DB. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-63082@lists.php.net to get a copy of this message | ||
ID: 12715
Updated by: sniper
Reported By: miki@canaan.co.il
Old Status: Open
Status: Bogus
Bug Type: Output Control
Operating System: Linux
PHP Version: 4.0.6
New Comment:
Not a bug. Ask further support questions on the appropriate
mailing list: http://www.php.net/support.php
Previous Comments:
------------------------------------------------------------------------
[2001-08-13 09:53:08] miki@canaan.co.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;
?>
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=12715&edit=1