What is the best/recommended way, from a web app, of programatically:
  1. printing a file to a local printer?
  2. downloading a file to a local drive?


Although I say "programatically", there will be user interaction; for printing I need to get up a printer selection dialog, while for downloading I need to get up a save/save as dialog.

I have found "kind of" solutions for these, but I am not really happy with them.

I know the users can, for instance, right-click on things in the browser to achieve this, but I'd like uniform mechanisms to do them in the code which work in all supported browsers.

Mike