Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl script to launch application from web browser

Status
Not open for further replies.
Aug 3, 2005
2
US
Hi,
I need to execute a shell script to start a tool on unix.I want to do this form a web page .ie. launch an application from web browser ( mozilla). So i have written the command in a perl script which works fine from command prompt , but doesent show the tool from web page. It just shows the print commands.How do I get the tool started form web page & show it there. Plz rply soon
Thankyou
__SJ
 
can you post what you already have?


Kind Regards
Duncan
 
This is the perl script i have written:\\

#!/usr/local/bin/perl
# begin CGI output
print("Content-type:text/html\n\n");
# print("$date \n");

$foo ="/opt/Acrobat/bin/acroread"; # Start the application
$status1 = system($foo);
print ("Foo = $foo status = $status1");
$cmd= system("date");
print("CMD=$cmd");
print (" HELLO ");

And this script starts acrobat reader when executed from command prompt , but not from web browser(mozilla in my case). Is there any other way I can start application from web browser in unix? Plz help. Thanks
 
Have you tried a simple,

`/opt/Acrobat/bin/acroread`;

That's what I use for initiating programs in the system from the browser all the time.

But I'm not sure what your expecting acroread to do.

Tony
 
You're expecting the web user to open an app in your uid X-Windows space, not easy, and I wouldn't expect it to be impossible, sorry can't be of further help.

You may need monitor processes to watch out for command queues

--Paul

--exits gracefully

cigless ...
 
I'm sorry, I don't think any of us really understand what you are trying to do.
What platform is your browser running on? Windoze?
If so, you'll need to set your perl script up in the cgi-bin folder on the Unix machine. Also, you'll need to change the Content-type to read "Content-type: application/pdf" and stream the pdf file straight to stdout. That will cause the browser to see an acrobat stream and run the appropriate application to deal with that stream.


Trojan.
 
Trojan's hit it on the head I think.

You don't want to just start the application, for the sake of starting it, you want to open the Reader with a PDF in it? Correct?

If what your trying to do is along these lines?
send request from browser to local webserver
Have local webserver fire up a GUI for a program

On *nix, it'll depend on the program's permissions allowing the user the webserver runs under allowing it. Also AFAIK, the webserver is run in console mode, it won't know where to direct the screen output, without some funky *nix trickery

--Paul


cigless ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top