Not possible. There is nothing in the http protocol that differentiates between a file being displayed inline inside other content and being downloaded separately. All the webserver knows is that the file was requested from the server and it delivers that file.
There are tricks you can do with client-side javascript, or with checking the referrer or user agent, etc. but all of them are easy to circumvent, and note that regardless of what you do that file has to be downloaded in order to be displayed in any capacity.