powerhouse has asked for the wisdom of the Perl Monks concerning the following question:

I am passing a zip file to the window:
$size = -s "$file"; open(DOWNLOAD,"<$file") or die $!; print "Content-Type:application/zip\n"; print "Content-Disposition:attachment; filename=$filename\n"; print "Content-Length:$size\n\n";binmode(DOWNLOAD);binmode(STD +OUT); while(read DOWNLOAD, my $buffer, 256){ print $buffer; } close(DOWNLOAD);
That works fine, but when it is done, it is just a white blank page. Is there a way to do this, where I can actually print to the window? I guess what I need, is a way to maybe delete the headers so I can print HTML headers. Or something to that affect. I have it open in a new window to pass the Zip file. I even tried having the window that opened the new window, close the window, after it opened it, but I could not get that to work. But that is Javascript, therefore another story.

Anyone know what I'm talking about? Sorry, It's like 4am or so here, so I guess I should quit for the night.

If you have any ideas I would LOVE to hear them.

thx,
Richard

Replies are listed 'Best First'.
Re: Printing a Zip file
by aquarium (Curate) on Jun 30, 2003 at 12:24 UTC
    a multipart page will work...first print the nice page and even a static download link if their browser doesn't support multipart pages. then print the second multipart header and your stuff. look up multi-part in cgi.pm documentation.