Hey,
Sorted the first bit out, had some problems with brackets in the query.
Now I have a new problem, it seems to not like how I am putting the filename together:
$row = mysql_fetch_object($result);
$filename = $row['filename'];
$file_size = filesize($filename);
$root_path = "/home/filelibrary/";
$myfile = $root_path . $filename;
$fp = fopen($myfile, 'rb');
header("Content-Length: $file_size");
header("Content-transfer-encoding: binary");
header("Content-Type: application/pdf");
header("Content-Disposition: inline; filename=\"" . $filename ."\"");
header('Expires: 0');
$content = fread($fp, $file_size);
fclose($fp);
print $content;
exit;
I'm getting errors like so:
Warning: stat failed for (errno=2 - No such file or directory) in /home/nbooth/public_html/beta/download.php on line 31 Warning: Cannot add header information - headers already sent by (output started at /home/nbooth/public_html/beta/download.php:31) in /home/nbooth/public_html/beta/download.php on line 36 Warning: Cannot add header information - headers already sent by (output started at /home/nbooth/public_html/beta/download.php:31) in /home/nbooth/public_html/beta/download.php on line 37 Warning: Cannot add header information - headers already sent by (output started at /home/nbooth/public_html/beta/download.php:31) in /home/nbooth/public_html/beta/download.php on line 38 Warning: Cannot add header information - headers already sent by (output started at /home/nbooth/public_html/beta/download.php:31) in /home/nbooth/public_html/beta/download.php on line 39 Warning: Cannot add header information - headers already sent by (output started at /home/nbooth/public_html/beta/download.php:31) in /home/nbooth/public_html/beta/download.php on line 40