fz315 has asked for the wisdom of the Perl Monks concerning the following question:

Hi,Monks:

I have a Windows box running Apache web server,cgi script written by perl, and an embedded device (integrated with printer) running linux kernel 2.6,ant web browser,boa http server, right now the device access Apache server in Windows box,is it possible call an executable in the device form cgi script in Apache( in Lan environment,no need to consider security)?

Thanks.

  • Comment on call browser-side local executable from server-side cgi script

Replies are listed 'Best First'.
Re: call browser-side local executable from server-side cgi script
by dragonchild (Archbishop) on Feb 01, 2005 at 16:23 UTC
    There are two possible ways I can think of.
    1. If the device calling the CGI script was a Windows box and you were using IE to do so, then you could write an ActiveX control (which could be in PerlScript, ActiveState's ActiveX Perl scripting language) which would do the trick. Unfortunately, you're not in this situation.
    2. Make a separate connection to the client from the server. The fact that you'd be making this connection as a result of a request from the client to the server is irrelevant. The client would have to provide a mechanism to do this.

    Being right, does not endow the right to be rude; politeness costs nothing.
    Being unknowing, is not the same as being stupid.
    Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
    Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.

      How about starting a new page (possibly in a new browser window) from the cgi script, with a content type associated on the client end with the desired executable?

      VGhpcyBtZXNzYWdlIGludGVudGlvbmFsbHkgcG9pbnRsZXNz
        This assumes, of course, that Javascript is enabled and enable-able on the client side.

        Being right, does not endow the right to be rude; politeness costs nothing.
        Being unknowing, is not the same as being stupid.
        Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence.
        Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.