Jump to content

Cross browser problem redirecting to Perl script


Beamer
 Share

Recommended Posts

I'm trying to do something simple but I'm not being very succesfull. Brief description: I have a text file which defines a list of executables which need to be available for download by people on my team. I have written a Perl script which reads this file and spits out an HTML page. The text file is good, the Perl script is working great.What I'd like to do is have this be dynamic. Why build the web page after each edit of the text file when I can just call the Perl script directly? In order to make life even easier for the end users I figured a redirect would be best. So they go to the page they always go to and I have that page redirect them to my Perl script (which is sitting in the cgi-bin directory of a local web server).This works like a charm when I'm using IE (I tried Windows 6.0, 5.5 and Mac 5.2) and it works fine when I'm using Safari (I tried 1.3 and 1.0.? I think). But this fails miserably on every Netscape and Firefox browser I tried (Netscape 4.77, 6.1, 7.2 Windows and Mac and Firefox 1.0.3 and 1.5, Windows and Mac).The mozilla stuff just asks me what to do with the Perl file (save or open). In fact this really doesn't involve redirect, it does the same thing if I access it directly. :) Any thoughts on how to make this work correctly?Thanks :)

Link to comment
Share on other sites

Some code and extra info are needed to build as an answer in here. :)The server You used is? (server name and is it Windows or Unix -server?)How You are doing that redirect? (code)Anyway, check server settings: *.pl shoud point to right program (perl) anduse *.pl as perl-file extension.

Link to comment
Share on other sites

Some code and extra info are needed to build as an answer in here. :)The server You used is? (server name and is it Windows or Unix -server?)How You are doing that redirect? (code)Anyway, check server settings: *.pl shoud point to right program (perl) anduse *.pl as perl-file extension.

This is all happening on an intranet that is inaccessible outside the firewall. It is a Windows based server. I have no control over the server nor would I know what to do with it if I did :) But I could probably ask someone if I know what, specifically, to ask. I guess the big question here is why IE is doing the right thing and Netscape/Firefox is not (and yes I know IE is probably not "doing the right thing" specifically but it is doing what I want it to do).The redirect code is very simple:
<html><head><meta http-equiv="Refresh" content="1;url=http://SOMEINTERNALSERVER/cgi-bin/qasds.pl" /></head><body><p> You will <a href="http://SOMEINTERNALSERVER/cgi-bin/qasds.pl">redirected</a> in one second.  If you seethis message after one second, please click on the redirected link. </p></body></html>

Link to comment
Share on other sites

It sounds like the redirect is not the problem at all. It has something to do with the perl compiler.For whatever reason Netscape and FireFox are not recognizing the cgi script and thus trying to download it.I have had this happen when I didn't have the php compiler installed properly except all browsers did this not just a few.I wish I had some better ideas for you but I would start looking at the server configurations to ensure the compiler is setup correctly. You may also want to check if firefox manages file extensions or something.Chances are if you solve it for either NN or FF it will automatically correct the other since Netscape 6+ and FireFox (Mozilla) both run on the Gecko browser engine.

Link to comment
Share on other sites

Thanks aspnetguy. Problem #2 in your referenced link is exactly my problem. I see that 'Content-type "application/octet-stream"' message in one of the browsers I tried.So it is off to find the server guy and explain the problem.Now if some IE guru could tell me what IE is doing to ignore that I'd really like to know (I test software for a living and knowing this sort of thing would be nice - thankfully I don't test web applications or I'd probably have gone loony ages ago :) )

Link to comment
Share on other sites

Okay - to put this one to bed - I spoke with a learned web server person. As usual the problem is with me and not the server.Perl was sending the HTTP header as "<content-type: text/html>" which is wrong (I wonder where I got that from? I always steal stuff so I doubt I made it up). Changing the line to "Content-type: text/html" makes all the browsers happy.So my guess is IE doesn't care or was able to make sense out of the mangled header and the Mozilla browsers were demanding I do it right.Thanks for your help.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...