tags:

views:

545

answers:

5

When I submit my basic form from the html file, it gives me the option to save the exe
I just want the exe to run instead. (To re-populate the template html file)
What do I need to do to just run the exe once the form is submitted?

<form action="Lib.exe" method=POST ID="Form1">
Enter Index to DELETE<br>
<input type=text name="user" ID="Text1">
<input type=submit value="DELETE">
</form>

I am running a web server. The html file and the .exe are in the directory to run web files.

Any help is appreciated.

Thanks.

+1  A: 

I assume the lib.exe does its template updating on the server, meaning you need to configure your web server to run exe files instead of serving them to the user. You do not specify the server you run (somehow I assume you run IIS...), but in Apache you would use <FilesMatch> in httpd.conf to add a handler for exe, something like this:

<FilesMatch \.cgi$>
    SetHandler cgi-script
</FilesMatch>

but adapted to exes. See mod_mime documentation here.

Tuminoid
A: 
  1. Please clarify your question. What are the OS and the web-server, does web server run with restricted permissions?
  2. Can you port Lib.exe into the language used by your web-site (PHP or ASP or whatever)?
  3. Executing server side scripts as CGI for small tasks can slow down the system as the OS needs to start a new process, allocate resources for the new process, etc... Compiled C++ can be slower than PHP interpreted by loaded module.
Muxecoid
A: 

Yes, need it to run on web server. I am using a light weight web server from GoAhead on XP. I can run .exe from the cgi-bin directory but html files wont display in here. I first had the .exe in the cgi-bin that displayed the entire web page with fprints and it worked, forms and all (for example: http://localhost/cgi-bin/Lib.exe) Would dislay an html page with form, and able to submit form to delete file.

Now I changed my architecture where the test.exe does not display any more, it just fills a seperate Lib.html template file. How can I get the html file to behave the same as when I was submitting the form through the old architecture.

I try calling the exe from the cgi-bin (where the server is configured to run it) but it still gives me the save option?

<form action="cgi-bin/Lib.exe" method=POST ID="Form1">
File Number to DELETE (i.e. - for scene_00021.xyz Enter 21)<br>
<input type=text name="user" ID="Text1">
<input type=submit value="DELETE">
</form>
Tommy
A: 
  1. Please clarify your question. What are the OS and the web-server, does web server run with restricted permissions?
    XP, GoAhead, NO
  2. Can you port Lib.exe into the language used by your web-site (PHP or ASP or whatever)?
    No, it's in C
Tommy
+1  A: 

Figured it out. I didn't have the content type in the CGI app.
" Content-type: text/html"
Without this the web server won't execute it. Newbie error. Thanks guys.

Now my html file runs on the web server, the form calls the exe in the cgi-bin directory and executes the deletion, specified by the user.

My next challenge is figuring out how to not actually display or go to the Lib.exe in the browser. I want it to run as it's doing, but stay at my html page as it is now updated. i don't want to have to manually go back to my html page.

Tommy