I don't think it should be that difficult. Here's a snippet from one of my scripts that I use for serving up files but it shouldn't take too much to extract what you need from it.
#!/usr/bin/perl -wT use strict; use CGI; $CGI::HEADERS_ONCE = 1; use constant BUF_SIZE => 4096; # Unbuffer the output stream: $| = 1; # Set the environment for Taint mode: BEGIN { $ENV{PATH} = "/bin:/usr/bin"; delete @ENV{qw (IFS CDPATH ENV BASH_ENV)}; } my $q = new CGI; my $source = &get_file_name($q); # IE is funky, doesn't seem to understand # "-type => 'text/octet-stream'", # wants a .whatever filename my $save_as_name = &get_saveas_name($source); if (open(IN, $source)) { print $q->header( -type => 'text/octet-stream', -attachment => $save_as_name ); my $buffer; binmode STDOUT; while (read(IN, $buffer, BUF_SIZE)) { print $buffer; } close IN; } else { print &get_error_page($q, $save_as_name, $!); } ...
In reply to Re^3: Save results on web page to doc or txt
by gsiems
in thread Save results on web page to doc or txt
by Wampa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |