Jump to content

[Answered] Cgi Program Downloads


chuck

Recommended Posts

I have a strange problem with a CGI program written in Perl on Johnny. I have a report from a user that when they invoke the script or hit one of the buttons it creates (which re-runs the script) that sometimes the code downloads instead of running the script. The script is in my /scgi-bin folder, and has a .cgi extension. It runs normally (most of the time) on Windows using Internet Explorer 8 or 11 (what I have). One of my testers was running Chrome on a MacBook and got the strange behavior. The thing is, I didn't know that the browser or operating system could even do this. I'd expect that the server would always run the program or download it when it receives a request for that URL.

 

By the way, the "most of the time" seems to be another glitch that I can't explain. Sometimes when I try to invoke the script it gives me a bit of garbage text instead of the form I expected. Generally hitting refresh will clear this.

 

Any help with either of these behaviors would be appreciated.

Link to comment
Share on other sites

Could you post the URL to your script please?

 

From http://heliohost.org/home/features/languages/perl :

Perl scripts are easy to configure and run. Just create a file in your cgi-bin directory under public_html, and place the Perl "shebang" line (#!/usr/bin/perl) on the first line of the file. Below this line you may write Perl code. Make sure you make this file's CHMOD permissions 755, and output a Content-type header before anything else.

Link to comment
Share on other sites

You can use http://chuck.heliohost.org/scgi-bin/nph-TeamRegistration.cgi?start=admin;affiliate=999 to run the program. For testing, you can use admin as the user name and test as the password. There's no data in the database, but you can push a few buttons and navigate to a few different pages.

 

This is an upgrade to a program I have been working on for a few years now and had hosted on another site last year.

Link to comment
Share on other sites

The first time I clicked onto your link with Chrome, I got the download screen but after that it gave me the page each time. I thought it might have something to do with the way you append your url with the semicolon (?start=admin;affiliate=999) so I added a few more semicolons to the url and got the download screen again. Can you append the url without the semicolon? Maybe like this: ?start=admin&affiliate=999

Link to comment
Share on other sites

That seems to work OK for me. I'll ask my other tester to give it a try.

 

Any ideas on the garbage output that I get now and again? It often happens the first time I try to run a site, but sometimes when I push a button. The output reminds me of what we used to get in the old days with a noisy modem line. I can't make it happen on demand, though.

Link to comment
Share on other sites

Any ideas on the garbage output that I get now and again? It often happens the first time I try to run a site, but sometimes when I push a button. The output reminds me of what we used to get in the old days with a noisy modem line. I can't make it happen on demand, though.

 

I have know idea what that could be.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...