I went through this look a couple of years ago. The simple truth is that what happens when a file is downloaded is dependent not just on the browser but the browser's user's settings.
Once I'd discovered this I simply settled for serving the file and letting the user deal with that.
If you want a sample of the code I used to do this, ask here and I'll post it.