in reply to Downloading things from a database
You can actually get away with not knowing the content-type, you just default to application/octet-stream.
Give the following a try, it is very nice. All you will need to do is perform a length() on the data and give a filename.
--eric
--eric
use CGI; my $size = length ($blob); my $filename = 'good_data.txt'; print CGI::header( -Content-Disposition => "attachment; filename=$filename", -Content-Type => 'application/octet-stream', -Content-Length => $size, -Pragma => 'no-cache', -Expires => 0 ); print $blob;
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: Re: Downloading things from a database
by merlyn (Sage) on Aug 08, 2000 at 09:42 UTC | |
RE: Re: Downloading things from a database
by Fastolfe (Vicar) on Aug 09, 2000 at 00:19 UTC | |
by Anonymous Monk on Jul 22, 2004 at 12:29 UTC | |
by upallnight (Sexton) on Jun 01, 2008 at 06:32 UTC |
In Section
Seekers of Perl Wisdom