in reply to Re: Re: Creating downloadable files on the fly
in thread Creating downloadable files on the fly
and here is the Apache config to go with it:#!/usr/bin/perl -w package Apache::ExcelTest; use Apache::Constants qw(:common); use Apache::Request; use Spreadsheet::WriteExcel; sub handler{ my $r = Apache::Request->new(shift); print "Content-disposition: attachment;filename=test.xls\n"; print "Content-type: application/vnd.ms-excel\n\n"; tie *XLS => 'Apache'; binmode(*XLS); my $workbook = Spreadsheet::WriteExcel->new(\*XLS); my $worksheet = $workbook->addworksheet(); $worksheet->write("A1","Hello, World"); $workbook->close; } 1;
To see it in action, go to http://jonallen.info/exceltest.<Location /exceltest> SetHandler perl-script PerlHandler Apache::ExcelTest PerlSendHeader on </Location>
Hope this points you in the right direction.
JJ
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Creating downloadable files on the fly
by Helter (Chaplain) on Oct 09, 2002 at 14:18 UTC | |
|
Re: Creating downloadable files on the fly
by Anonymous Monk on Oct 10, 2002 at 10:45 UTC | |
by jj808 (Hermit) on Oct 10, 2002 at 11:12 UTC | |
|
Re: Creating downloadable files on the fly
by surfmonkey (Acolyte) on Oct 10, 2002 at 15:08 UTC | |
by jj808 (Hermit) on Oct 10, 2002 at 16:54 UTC | |
by surfmonkey (Acolyte) on Oct 11, 2002 at 09:47 UTC |