odf download problem in IE
Posted: Tue Dec 19, 2006 5:15 am
Hi
I am using the following code to download a pdf from my website
This works fine in firefox but in IE I can only save it, when I attempt to open it a error appears in acrobat saying "File cannot be found"
Does anyone see a problem with my method#?
Thansk in advance
I am using the following code to download a pdf from my website
Code: Select all
<?php
require_once('../includes/inc.functions.php');
session_start();
$paper_id = $_POST['paper_id'];
$filename = $_POST['filename'];
if(isset($_SESSION['valid_user']))
{
global $PAPER_PATH;
$path = $PAPER_PATH . $filename;
//print $path;
if (file_exists($path) && !headers_sent() )
{
$size = filesize($path);
$file = basename($path);
//header("Content-Type: application/octet-stream");
//header("Content-Type: application/download");
//header("Content-Disposition: attachment; filename=$file");
//header("Content-Length: $size");
//readfile($path);
//header("Location: $path");
header("Content-Type: application/pdf");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Length: $size");
readfile($path);
}
else {
print 'There was a problem with the download, please contact Training Journal for assistance';
}
}
?>This works fine in firefox but in IE I can only save it, when I attempt to open it a error appears in acrobat saying "File cannot be found"
Does anyone see a problem with my method#?
Thansk in advance