You might find some better info in the link provided by @soac, but here is an excerpt from some of my code for PDF files only:
Note that this opens the PDF in the browser rather than downloading it perse, although you can save the file locally from within the reader. Using readfile() would probably be more efficient (and cleaner code) than the old way of opening the file via a handle the way I do in this example.
readfile($full_path);