note 41679 added to function.header
| From: | crb at e-duct-tape dot com | Date: | Mon, 19 Apr 2004 16:08:48 +0000 |
| Subject: | note 41679 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-68334@lists.php.net to get a copy of this message | ||
When sending a file to the browser, I have gotten the filesize and name all worked out, however
there is one thing I cant figure out. In the "percent completed" box in ix. it displays
the script file name that is sending the file, instead of the filename of the file that it is
sending. below is the code I am useing and a link to an image of the percent complete box. if anyone
has any way to correct this I would appreciate it.
<?php
if($id) {
@MYSQL_CONNECT("localhost","user","password");
@mysql_select_db("software");
$query = "select bin_data,filetype, filename, filesize from files where id=$id";
$result = @MYSQL_QUERY($query);
$data = @MYSQL_RESULT($result,0,"bin_data");
$type = @MYSQL_RESULT($result,0,"filetype");
$filename = @MYSQL_RESULT($result,0,"filename");
$filesize = @MYSQL_RESULT($result,0,"filesize");
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header('Content-Transfer-Encoding: none');
Header( "Content-type: $type");
header("Content-Disposition: inline; filename=$filename");
//header("Content-Disposition: attachment; filename=$filename");
header("Content-length: $filesize");
echo $data;
};
?>
here is the link to the image.
http://e-duct-tape.com/dl.jpg
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+41679
Delete -- http://master.php.net/manage/user-notes.php?action=delete+41679&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+41679&report=yes
Search -- http://master.php.net/manage/user-notes.php