hehe, ok. But i guess there should some way to atleast a run a shell command, since windows and IE have activeobject.
There should be something with FF and Linux may be?
Ok, is there a non browser solution?
I thought of doing like this in worst case. Give a force download of the file, attach a shell command to monitor the completion of the download and then execute the file? So since u say linux shell commands cant be run is there any other way?
Okay, this seems bit complicated. Let me clear my requirement.
1: User will click a link or button, this will start a file download. This file has to be downloaded forcefully, without asking save cancel or anything like that.
After downloading it should be executed autoimatically.
Can this be achieved without serever side scripting in linux OS. Here the end user who is going to click the link uses linux.
That’s the biggest security hole that Microsoft ever created. They locked it down pretty tight in IE7 so that 3/4 of what it could do in IE6 was disabled as it was too risky and Microsoft decided they couldn’t afford the millions of trillions of dollars the legal cases would cost them. It was only ever intended for use on intranets and is now locked down so as to prevent its use on the internet as much as possible. IE now disables all JavaScript run locally in the web browser by default requiring that each local file you try to run there be separately approved - simply because they couldn’t provide the necessary security any other way. Other browsers can happily run local JavaScript because it has no access outside the browser.
The browser provides the most potential security issues with running JavaScript and so JavaScript has the least functionality available to it there.
If you want to run JavaScript locally outside the browser then it is one of the three languages supported by Adobe Air and there it can read and write files. There is a version of Adobe Air for Linux just as there is one for Windows.
If you want to force such a thing to happen you should look more on the flash side of things and have a client running which will then accept the download, but this too won’t really work as flash doesn’t have access to the local filesystem due to security issues. (Air does though)
Basically, this cannot be done at all unless you actually make a client that has local filesystem permissions, and on Linux this usually means write permissions, which leads us down the root access path, which basically goes and says “your answer is no”.
It is to a degree but not really in this context as RUN being a button relies on the end user’s discretion when clicking it.
The same way as if you open an email with an attachment, it’s an executable file and you “just trust it and run it”… Probably a no-no on the paranoid-security-front as anything could contain malware. On linux it’s not as common though.
Sorry for coming back again, After our discussions i was in a mind frame that this cannot be done in linux and left it without testing.
But today i saw FF in macOS, asking for same run like option, “Open With”… How is it achieving that??
After downloading how FF is capable of firing a command or event to run that downloaded file in another application. Here its kind of linux as well…
So the option might have come from the server side code, so no prob with that. But all i am interested is the second step done by the browser. When i click “open with” it downloads to temp file (fine till this) and executes the file from there (how this is done?)
How is the browser able to fire that command?
And one more thing, if i select do this automatically for following files then all my files will be executed w/o asking!!
So surely run button in windows can be implemented in linux as well.
yes, how is the browser have the permission to execute that file.
And one more thing, How come the browser wait for the download to complete and then execute it. Since it waits is it attaching a process on the BG which polls or waits for this download to complete? If thats the case then executables will be run without warning.
Ok so is there a way through javascript where i can sense the starting of download and what type of file is it?
So that i can then use some plugin to give a message to OS to lookout for the completion of download(any info’s on how to check this) and then start executing it.
No, JavaScript doesn’t provide such abilities. You can ask the same type of question in many ways, but you will continue to receive the same message, that JavaScript is limited in such ways.