Launching an application from a web page without displaying the file open\save prompt in IE
I have an application that can be passed parameters by supplying a local file containing the parameters on its command line. We also have an ASP.NET web application that can return out applications parameter file. We would like the end user to be able to clic开发者_StackOverflow社区k on a link to an ASP.NET page that generates the parameter file and have IE download the file, start our application and pass the parameter file on the command line. I have almost achieved this by defining a proprietary MIME type and adding entries to the local machine to define this MIME type. However I cannot determine how to get IE to just open our application without prompting the user to Open or Save the file.
My .ASPX page sets the 'Content Type' to my proprietary MIME type and I set the 'Content Disposition' to 'filename=file.foo'. On the local machine I have registered .foo and associated my MIME type with .foo. The part I am a little fuzzy on is what registry entries I need to add to the local machine to make this work. MIME\file type registry entries are not very well documented as far as I can tell.
This is by design - any browser that would allow anything to be downloaded and run automatically just based on mime type is basically completely broken from a security standpoint. I doubt you could do that (or should..).
精彩评论