Woah, what on earth are you trying to achieve here?
I think a little more detail is required

from the one-liner above, it sounds like you're trying to mimic what browsers already do (Ie. manage file downloads)
This is not a good thing to try to do

if you try to override people's browsers,
1) you won't succeed, you will not be able to support all browsers on all platforms under all circumstances
2) even if you do, you will piss people off by doing it
3) any simple update to a browser could render your mimic worthless

I'm assuming the "open" option means download the file to a temp location and open it in some application local to the user
you cannot do this (not properly anyway)
you can't control what the user does on his machine

seriously, if you want to offer something for download, just use a simple anchor
let the user decide what they want to do with the file