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!

Why do I get a download box when running a Perl script?

Status
Not open for further replies.

Frank123

MIS
Sep 17, 2001
77
US
I have a weird error, I've got 3 scripts in a cgi_bin folder that are called from buttons or links on my web pages (on NT 4.0 server using IIS). 2 of the scripts work fine, but the third one makes the download window pop up. I'm really confused, I would think the download window would pop up for all of them or none of them. hmm.. I double checked my folders settings and the execute scripts is checked and all the files are set to read and write.. Maybe one of you could help me out..
 
Ok, I played around a bit with the .pl file and found out it doesn't like the "open(File, ">$filename") || die "Can not open $filename?\n\n";
I know the filename is correct but my hunch is the ">" is the problem. Once again I double checked the permissions under that folder in IIS and the execute (including script) is checked, and the read, write is checked. ??? Don't know what else to do..
 
open(File, "[red]>[/red]$filename") .....


' looks perfectly normal to me....
The '>' tells the open function to open a new file or overwrite an existing one.

see "perldoc open" 'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
I'm pretty sure the script is correct, but I think I have the permissions to a file set wrong (but don't know where or what). If I just run the script without the ">" before the filename, it runs fine. But if I keep it in the script, my browser trys to download the script. And everywhere that I checked I have read and write permissions on the file that I'm writing to.. ??? Very confused...
 
I figured it out, I didn't give full permission under the Windows NT explorer properties for that particular folder. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top