in reply to Re: Re: Re: Creating downloadable files on the fly
in thread Creating downloadable files on the fly

I still get exactly the same result. On my local machine the excel data appears in text format. It worked from your URL though. I have checked the MIME headers supported by my browser and vnd-ms.excel is listed:
GET /HTest HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, applicati +on/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, * +/* Accept-Encoding: gzip, deflate Accept-Language: en-gb Connection: Keep-Alive Host: localhost User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0) HTTP/1.1 200 OK Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Transfer-Encoding: chunked Content-Type: text/plain
Do I need to install libapreq to get this to work? I haven't yet managed to get it to compile (it tells me I don't have mod_perl installed!)

Replies are listed 'Best First'.
Re: Re: Creating downloadable files on the fly
by jj808 (Hermit) on Oct 10, 2002 at 11:12 UTC
    Well if you don't have mod_perl installed (as stated in the original question), you won't be writing code as a handler, and also won't be tying the output to Apache.

    Try this in a 'normal' CGI script:

    #!/usr/bin/perl -w print "Content-disposition: attachment;filename=test.xls\n"; print "Content-type: application/vnd.ms-excel\n\n"; binmode(STDOUT); my $workbook = Spreadsheet::WriteExcel->new('-'); my $worksheet = $workbook->addworksheet(); $worksheet->write("A1","Hello, World"); $workbook->close;