I have written a script that creates an excel file and then zips it up using wzzip.exe. I have found that I cannot return both the HTML page to the user and create a zip file and generate an email (using MIME) with the attached zip file.
If I first return the html page it works, as does the generation of the zip file ... but the email does not arrive. If I first create the zip file and the email it returns the email with the zip file but I get the CGI Error "The specified CGI application misbehaved by not returning a complete set of HTTP headers." If I comment out the command line calls (either of them as shown below) I can do both things and attach a previously generated zip file. I want to use wzzip as most users will have winzip and when I generated zip files using the archive zip module I could not use winzip to open them. Running Wzzip I have used the following code:1. my $zippath = qq(\"C:\\Program Files\\WinZip\\wzzip.exe\" \-a \"$zi +p_file\" \"$filetoZip\"); my $status = system ($zippath);
I think it may have something to do with winzip changing the stdout or stderr ... but not sure how to stop this. I would really appreciate a perl monk to help me. Thankyou, Hshepherd2. my $winzip= qq(\"c:\\program files\\winzip\\wzzip.exe"); open OUT, "| $winzip $zip_options $zip_file $filetoZip" or die "wzzip pipe: $!"; print OUT "\n"; close OUT;
In reply to CGI Wzzip and MIME by hshepherd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |