using plugins
| From: | Anthony | Date: | Mon, 05 Nov 2001 17:23:53 +0000 |
| Subject: | using plugins | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-73508@lists.php.net to get a copy of this message | ||
I have a page that needs to load some large PDF files. I want to be able to let the user know that it is downloading by showing a loading... and percent complete as it goes along. I tried using the below script to see if I could get it to work. The page download the file, but then displays the file as text. How do I get the browser to load the adobe acrobat reader plugin and view the variable information with it? Or should I be doing thin in an other manner? Any sugestions are greatly appreciated.
<?php
$filename="microliteXPflyer.pdf";
$fp=fopen($filename,"rb");
if ($fp)
{
header('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">');
header("Content-type: application/octet-stream\n" );
header("Content-transfer-encoding: binary\n");
header("Content-length: " . filesize($filename) . "\n");
header("Content-disposition: attachment; filename=$filename\n");
$contents="";
while (!feof($fp))
{
$contents .= fread($fp, 10000);} fclose($fp); print($contents); } // end if ?>