PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi all
I have a problem and am confused
I have many pdf files in my website and desire to show content of each pdf file when user click on its link (such as this http://www.mywebsite.com/show.php?file1.pdf
I use this script for opening pdf files and tell user browser to show it(open adobe reader in browser):
why even bother with this, the net effect is the same as just having their browser point directly to the pdf file, i dont see the logic in this, just wasting server processing power
dull1554 wrote:why even bother with this, the net effect is the same as just having their browser point directly to the pdf file, i dont see the logic in this, just wasting server processing power
Not very helpful...
If you have a look at the [php_man]pdf[/php_man] functions in the manual and scroll down to the user-notes, you'll discover this:
pdf's will only open in a browser if it supports and is set up to use Adobe as a plugin for the browser, not all browsers support this especially older browsers and some non Microsoft ones.
patrikG - setting the filename through content-disposition can cause IE to spit out the "download" dialogue box. It's part of the security issues. As you're (possibly) hiding the extension of the file, it plays safe and asks you what to do.
Setting the content-type header is enough to let the browser know it's a PDF coming down the line. Any installed plugins will take that and render it for you.
I assumed the guy who has problems with viewing the PDF is using IE and it sounds very much like a header() issue (alas, IE, alas, yet again ). Can you reproduce the error on your machine?
well i hyave totally rebelled away from Microsoft....the only microsoft product i use is a wireless optical mouse and i dont know that i even trust that.....