note 41679 rejected from function.header by betz

From: Date: Mon, 19 Apr 2004 16:16:16 +0000
Subject: note 41679 rejected from function.header by betz
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-68335@lists.php.net to get a copy of this message
Note Submitter: crb@e-duct-tape.com ---- 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

« previous php.notes (#68335) next »