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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXE file executed on client, not server....

Status
Not open for further replies.

Ito2233

MIS
Sep 2, 2003
77
US
I have created an executable file from a script written in PERL. I have put it in the SCRIPTS directory of INETPUB, as instructed by some websites. The SCRIPTS directory is configured to allow for the execution of EXE files. But whenever a user clicks on the submit button of a form (which is supposed to trigger the execution of the file), the user gets a prompt for downloading the file. Ie, the file is not being executed on the server.

I'm a newbie to PERL/CGI, and I would like to understand what it is I'm doing wrong.

Thanks
 
Is there any particular reason why you're using an EXE file rather than the PERL file? Most servers have to be configured to run an exe file because of certain security issues.

There's always a better way. The fun is trying to find it!
 
Seems to be more an IIS issue than Perl. Did you set 'Execute the authorizations' to script and executables in your web directory ?
 
tviman: The reason I transformed the PERL file into an executable was so that I wouldn't have to load the PERL interpreter, since our web server already has ASP and Java engines/components running on it.

zephan: In IIE, I have EXECUTE PERMISSIONS set for SCRIPTS AND EXECUTABLES for the Inetpub\Scripts folder, which is where my script is located. So I'm not sure why I am still getting a prompt to download the file when I click on the SUBMIT button of my questionnaire.

Thanks
 
If your link includes the .exe file extension, your browser is going to try to download it. You'd be far better off by turning your script into ASP or create an ASP script that calls the EXE file and use the ASP script as your link.

There's always a better way. The fun is trying to find it!
 
Well, I decided to use the perl file itself instead of an executable. The PERL interpreter is now installed on the server. However, I'm still getting a prompt to download form.pl when I click on the submit button of my form.

Does it have anything to do with the ACTION attribute of the FORM tag? My ACTION attribute is ACTION=form.pl

Thanks
 
Hmm did ya set .pl files to be parsed by the server? setting executing rights is not enough.. you have to tell the server that he has to parse files with the .pl extension.

Since you installed perl after installing the webserver, the server might nog parse the .pl extension. If you have an IIS server you might check this link:




InDenial
 
Hi InDenial,
The page you linked to was very informative and easy to understand. I followed the instructions, but the problem remains. I'm still getting the prompt to download the file.

Now, there was something in the instructions about setting up a virtual directory. I did that, but I'm not sure what that was for. In other words, I don't know where I'm supposed to reference that virtual directory. There was nothing about that in the page. I'm still referencing the physical location of the file.

Any input would be highly appreciated.

Thanks
 
You may want to check the method call on your form. If you don't have it, this could be the problem. Your form call tag in the html should look like:
<form method="POST" action="SCRIPT_URL">
Just a thought . . .

The Youthman
 
Yeah, that's what I have on the HTML file. The only difference is that now I have a file:////address URL.
 
sounds like a frontpage or dreamweaver problem
--Paul

It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
I suspect it's not a Dreamweaver problem, because before both the HTML file and the script were in the same directory (for testing purposes), and my ACTION attribute looked like: ACTION=form.pl. And still, I was being prompted to download the file when clicking on SUBMIT.
I don't know...I'm losing hope of figuring this one out.
 
You have to access scripts through a webserver, what webserver are you using?
--Paul



It's important in life to always strike a happy medium, so if you see someone with a crystal ball, and a smile on their face ...
 
I'm using IIS 5.

I created the following directory for my script: C:\cgi-bin.

On IIS, I created a virtual directory (called cgi-bin too) pointing to C:\cgi-bin. For this directory, I checked the boxes for SCRIPT SOURCE ACCESS, READ, WRITE, LOG VISITS, and INDEX THIS RESOURCE.

Execute permissions are set for SCRIPTS AND EXECUTABLES.

In the application mappings, I have the .pl extension with the executable path E:\perl\bin\perl.exe "%s" %s.

Verbs: Limit to GET, HEAD, POST.

I checked SCRIPT ENGINE and CHECK THAT FILE exists.

Now, I don't really know if I need to do something with this virtual directory. My script is in its directory. My HTML file with the form is in its directory (a separate one). The only link between the two is the ACTION attribute of the FORM tag, which points to another drive on the same server, where the PERL script is located.

I should add that I tried changing the .pl extension to .cgi. What began happening then is that instead of getting a prompt to download the file, the browser opened up the file and displayed its code in the browser window. Nothing got executed though. I then tried to associate the .cgi extension with PERL, but that didn't change the results.

Where am I making a mistake?
Thanks

 
a virtual directory is a reference to a directory wich does nog reside within the webfolder...

if your webfolder is: c:\inetpub\ and you create a directory within that folder it is just a webfolder adn it will appear directly in your webfolder.If you create a directory like c:\cgi-bin and you want it to be included in the website then you have to create a virtual directory wich references to that c:\cgi-bin folder.

If you follow everything on that page it should work. I set it up just a couple of minutes ago and works like a charm.



InDenial
 
You said:

In the application mappings, I have the .pl extension with the executable path E:\perl\bin\perl.exe "%s" %s.

Did you do this on the virtual directory or on the main web? (should be done on the main webfolder)

Verbs: Limit to GET, HEAD, POST.

What happens if you set it to all? Not what you want probably but at least ya can rule out missing something there.


InDenial

 
I'm getting somewhere. I now have my ACTION attribute as ACTION= I didn't know I had to point to this virtual directory.

Now, I'm getting this error message, which at least is better than before:
____________
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:

Can't open perl script "E:\<servername>\cgi-bin\form.pl": No such file or directory
 
InDenial: The application mapping for .pl was done for the virtual directory. I'll try to implement your suggestion now.
 
Well, now I'm getting a different error. I think the server part has been solved, and everything should be working correctly. The error below should have something to do with the programming in my script, no??
_____________
CGI Timeout
The specified CGI application exceeded the allowed time for processing. The server has deleted the process.
_____________

Sounds like the program is waiting for something, and not getting it.
Anyway, thanks for the help. I guess I now have to debug the program (which passed a syntax check).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top