I ran into a problem when switching my pages over to a secure site (HTTPS). Specifically, there is a page where I am downloading a PDF file to open into the browser's Acrobat viewer. The download works perfectly fine in a non-secure mode (HTTP). When I switch the page to HTTPS, the download fails. IE and NS browsers seem to no longer recognize that they are dowloading a PDF. One additional note, the PDF file is stored in a MySQL db table, not on the file system.
Here's a copy of code that retrieves the PDF file and sends it to the browser:
<?php
//Display report
require_once('baseincludes.php');
session_start();
validCustomerUse();
//create short names for variables
$reportid = trim($_GET['reportid']);
$userid = $_SESSION['userid'];
if (empty($reportid) || empty($userid) )
{
echo 'Error: Unable to display report<br>';
}
else
{
$result = retrieveReportData($reportid, $userid);
if ($result->isError())
{
echo $result->resultString();
}
else
{
$rowObject = $result->resultObject();
header('Status: 200');
header('Content-type: application/pdf');
header('Content-length:'.$rowObject->report_filesize);
header('Content-Description: PHP Generated Data'."\r\n");
echo $rowObject->report_file;
}
}
exit;
?>
Any ideas or help would be appreciated.
Scott