If you provide a link to this file on your page:
<a href="http://example.com/foo.doc">Open foo.doc</a>
it will be opened with the default application associated with this extension on the user computer.
If you want it to open inline inside the browser without any popup dialogs you could try setting the Content-Disposition
HTTP header on the server: Content-Disposition: inline;filename=foo.txt
. Of course the client application must have a plugin version which works with the browser and is capable of opening files inline (this is the case for example with Adobe Acrobat Reader).
As far as the second part of your question is concerned, there's absolutely nothing in the HTTP protocol specification allowing you to do this, so in order to achieve it it needs to be something custom-made. The client program needs to be able to talk to the server and send the modified version of the file back.