faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

22 of 31 people (71%) answered Yes
Recently 8 of 10 people (80%) answered Yes


Can I stop "download this?" promt when opening an "exe"(on the users pc) from html?

Apr 6th, 2008 18:45
ha mo, Colin Fraser, Kevin Smith,

Currently, you cannot, nor is it likely that you will be able to. This
is for two reasons, the first is security. How long do you think it
would be before someone has used JavaScript to possess your computer if
JavaScript had this sort of capability built into it? 
The other issue is the more practical one of this being the browser
itself. The browser does not recognise the *.exe file type, there is no
plugin to allow it to handle these files without instruction from the
user. What you may be able to do is to learn how to write an exe handler
plugin. I am sure there would be lots of people who would thank you for
that, maybe rewarding you with a good old Soweto necktie. 
Think about the risk to your computer, let alone anyone else's, if exe
files could be handled by the browser automatically. 
I guess the moral here is that while such an idea can be attactive, it
poses a huge risk. I am sure the plugin could be written, but the
attendant dangers are just too far beyond reasonable risk to justify
even considering the idea.