in reply to Creating an HTML file, then (g)zipping it up for a user to dl it?
Based on what I can glean from this thread as to your intentions I think what you are after is Archive::Zip to create the archive and then you can send that archive to the browser in binary mode with the correct HTML headers being set. This is untested, but here is a sniglet of code that I think should work for you:
#!/usr/bin/perl -w ################################3 use strict; use warnings; use diagnostics; use CGI; use Archive::Zip; my $cgi=new CGI; print $cgi->header("Content-type: x-applicaition/zip\n\n\n"); my $arch = new Archive::Zip; my $member = $arch->addFile('myfile.html'); binmode(STDOUT); # THis is suspect, I haven't done this for a while... +. $arch->writeToFilehandle(\*STDOUT); . . . .
The only part I am hazy about is the binmode part since I haven't done that in a while. At any rate TIMTOWTDI.
Peter @ Berghold . Net
Sieze the cow! Bite the day!
Nobody expects the Perl inquisition!
Test the code? We don't need to test no stinkin' code!
All code posted here is as is where is unless otherwise stated.
Brewer of Belgian style Ales
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Creating an HTML file, then (g)zipping it up for a user to dl it?
by BUU (Prior) on Aug 10, 2003 at 17:43 UTC | |
by blue_cowdawg (Monsignor) on Aug 10, 2003 at 21:29 UTC |