in reply to Re: CGI Wzzip and MIME
in thread CGI Wzzip and MIME

Managed to get it to work finally by replacing the print location url reference with code as shown below and by redirecting (prior to excuting wzzip.exe) the STDOUT and STDERR to text files.
print "Content-type: text/html\n\n"; print "<HTML><HEAD>\n"; print "<TITLE>CGI Test</TITLE>\n"; print "</HEAD>\n"; print "<BODY><p>Blah Blah. For another enquiry <A HREF=\"http: +//www.something.com/somepage.html\">Click Here</A>\n"; print "</BODY></HTML>"; my $stdout = "stdout.txt"; my $newstdout = 'C:\SomeDir\SomeSubDir/' .$stdout; my $stderr = "stderr.txt"; my $newstderr = 'C:\SomeDir\SomeSubDir/' .$stderr; # redirect STDOUT & STDERR open (my $oldstdout, ">&STDOUT") or die "Can't open old STDOUT: $!"; open (my $oldstderr, ">&STDERR") or die "Can't open old STDERR: $!"; open (STDOUT, ">$newstdout") or die "Can't open STDOUT: $!"; open (STDERR, ">>$newstderr") or die "Can't open STDERR: $!"; my $zip_options = "-a"; open OUT, "| $winzip $zip_options $zip_file $filetoZip" or die "wzzip pipe: $!"; print OUT "\n"; close OUT;
This then captured STDOUT from WZZIP rather than the program trying to send it as HTML page. I sent the HTML page back prior to wzzip ... I realise to some purists this is a terrible thing to do but as it is a repeatable job & text files can be checked for errors & it speeds up processing what the heck!