I am trying to download a file stored in a mysql database. When I try to use php to output the file, it does not get saved with the proper file name, but instead both IE7 and FF5 do not save the flyer with the name and type that I have given it but instead try to save it as displayFlyer.php which is the name of my script. The server is running on an XAMPP setup of Apache 2.2.,4
MySQL 5.0.33, PHP 5.2.1, PEAR HTTP_Download 1.1.1
================================================== =====
Source Code:
================================================== =====
[php]
<?php /*php database stuff is all working properly.*/
$item = $result_set->fetchRow();
require_once 'HTTP/Download.php';
$params['data']=$item['flyer'];
$params['cache']=true;
$params['contenttype']=$item['flyerType'];
$toDownload = new HTTP_Download($params);
$toDownload->setContentDisposition(HTTP_DOWNLOAD_ATTACHMENT,$i tem['flyerName']);
$toDownload->setCacheControl("public",3600);
$toDownload->send(true);
exit;
?>
[/php]
================================================== =====
I have also tried by using the header commands and writing from scratch and am getting the exact same result.