Re: Displaying a pdf inline

From: Date: Wed, 15 Sep 2004 03:29:08 +0000
Subject: Re: Displaying a pdf inline
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-196684@lists.php.net to get a copy of this message
Curt - Thank you for the quick response. The file is being sent and the PDF reader does try to open it, but it is corrupted. When I change the Disposition to header("Content-Disposition: attachment; filename=image.pdf") and save the file, it cannot be opened do to errors within the file. Yet, the file can be opened on the server. Am I missing something simple here? Todd Curt Zirzow wrote:
* Thus wrote Todd Cary:
After reading the online documentation, it appears that I should be using the following code, however it does not appear to work. Are there some obvious errors? ...
         header("Content-Type: application/pdf");
         header("Content-Disposition: inline; filename=image.pdf");
         //header("Content-Disposition: attachment; filename=image.pdf");
         header("Content-Length: $download_size");
         header("Connection: close");
The problem comes down to how the client is configured to display a pdf file. IIRC, inline doesn't force the browser to display it within the browser, it all depends on the content-type, and if a plugin is suppose to load within the browser at that point. If you search the archives, your answer may be revealed :) Curt


« previous php.general (#196684) next »