File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Linux / UNIX and the fly likes Running a shell script in browser automatically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Running a shell script in browser automatically" Watch "Running a shell script in browser automatically" New topic
Author

Running a shell script in browser automatically

V Chauhan
Ranch Hand

Joined: Nov 15, 2002
Posts: 70
Hi,

I have a linux application. The installer for this application is streamed from the server with a mime type of "application/x-sh".

When the browser receives this streamed data, it displays a message asking the user to
1. select a program to open with and displayes a browse button or
2. save it to disk.

I want to change this behavior, so that the user is presented with an option to open with "sh" automatically. The user should not be made to click the browse button and than select /bin/sh.

It would be even better if the browser runs this streamed data automatically with the /bin/sh program.

This behavior can be configured from the browser (setting the behavior for .sh file types). But I do not have any control over the user's browser settings.

Is there a way to enforce the desired behavior.

I will appreciate any help/suggestions on it.

Thanks,
Basu.
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

If it would be possible, we would get the big virus-invasion in linux.

I'm glad, it's not possible.


http://home.arcor.de/hirnstrom/bewerbung
V Chauhan
Ranch Hand

Joined: Nov 15, 2002
Posts: 70
I agree, if the script is executed automatically without the user knowing it, it would be be a big problem.

I am looking for a behavior, which is similar to what happens when an user downloads an executable on Windows. The user should see a pop up displaying an option of opening the script with "sh". The user can choose open the file or save it to the disk.

Any thoughts on how to enforce this behavior.

Thanks in advance,
Basu.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15632
    
  15

Originally posted by Stefan Wagner:
If it would be possible, we would get the big virus-invasion in linux.

I'm glad, it's not possible.


Actually, unless the browser forbids it, it is possible. All that's required is that the MIME definitions for ".sh" files be set to run rather than save, as Basudev notes.

Firefox does support download/run-with option dialogs for things like ZIP files, so there's probably a MIME preference for that, however, it's at the user's control, not the webservers and thank goodness that's so or we would get the "big virus-invasion".

Even if the option were available, however, I'd not want it. Windows users are notorious for clicking the "OK" button, and despite the elitist attitudes of some regarding Unix, I'd not want to wager that a non-geek Unix User is going to be any more discerning that an non-geek Windows user.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Running a shell script in browser automatically
 
Similar Threads
Outlook Express
Applet for Mass File Upload
File Chooser Dialog box
configuring editplus
focus