First you must understand that when the user's browser displays some file/content, it is already on the user's machine. It has been downloaded already. There is no magic "the content stays on the server, but the user can see it". Data are always transferred from the server to the user, and the user can make the data stay on his machine - one way or another.
If you understood this, you have several options:
- You do not care about the user having the file. This is the most sane option. All other methods are some sort of "DRM" which users hate.
- Transfer the data the user shall see to the browser only:
- generate an image of the part of the document the user is looking at and send that to the browser. The user has no text data and needs to do many requests to get all of the document downloaded.
- write a browser plugin (java, flash, javascript) that reads encrypted documents from the server, unencrypts them (again, on the user's machine - which means he can peek into it) and displays it. This way, the user doesn't simply get the document but needs to decrypt it.
There are existing solutions, i.e. embedding slideshare presentations with disabled download option. Don't try to invent your own, especially not if you don't want to go the long way with support and continuous enhancements.