This is my first post here, hope this is just a start.
i have 3 questions.
Note : All my queries are with reagard to linux
3) I want a file to be downloaded and executed automatically. Like the RUN button in windows while downloading. How do i achieve tat.
thanks in advance.
adam_chrapkowski — 2011-09-22T03:02:12-04:00 — #2
paul_wilkins — 2011-09-22T03:04:12-04:00 — #3
The answers to all three of those questions are 1. no, 2. no, and 3. can't be done.
Are you interested in looking at non-web browser solutions instead?
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?
paul_wilkins — 2011-09-22T03:15:13-04:00 — #5
How about using XULRunner in FF to run the script?
My initial action will be to click a link, so i cannot make it entirely non-browser. The first action event is from browser.
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.
felgall — 2011-09-22T06:23:20-04:00 — #8
smftre — 2011-09-22T06:31:48-04:00 — #9
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".
Hmm so basically the RUN button in windows is a security breach!
Thanks for the inputs i will check through adobe air options for this.
smftre — 2011-09-22T06:44:39-04:00 — #11
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...
smftre — 2011-10-03T08:18:21-04:00 — #13
That is because that file type is not recognized by the OS and it asks you what it should do with it.
paul_wilkins — 2011-10-03T08:18:25-04:00 — #14
That's most likely to be the operating system itself asking you how to deal with an unknown file type.
It asked for zip file, which it found particularly which application to use to open it up.
I found this link which explains how to bring up that option in all browsers, so there is an option and this is through browser not OS. http://www.php.net/manual/en/function.header.php#102175
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!!
paul_wilkins — 2011-10-03T09:03:24-04:00 — #16
It's definitely server-side header setting that control that.
"Content-Disposition: attachment; ..."
How? As in, how is the browser able to have the permission to run the file?
That's right, because you selected to "do this automatically" for that particular type of download.
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.
felgall — 2011-10-03T14:17:31-04:00 — #18
The browser doesn't run the file - the operating system does. Only the operating system can tell when the file has finished downloading.
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.
paul_wilkins — 2011-10-03T22:53:46-04:00 — #20
next page →