the first one is impossible. a computer must download the file prior to opening it. there are some files that instantly open (some pdfs do that), others must be downloaded.
second one is simple. you'd need a custom configured server which instead of reading and sending the file to the client, it sends an HTTP 301 Moved Permenantly redirect instead of the usual HTTP 200 Found which would normally be sent when a client requests the file