2008/8/19 Carl Franks <[EMAIL PROTECTED]>:
> 2008/8/19 Dermot <[EMAIL PROTECTED]>:
>> sub downloadFile {
>>
>> my ($name, $filepath) = @_;
>>
>> my $length = (stat($filepath))[7];
>> my $res = $c->response;
>> $res->content_length($length);
>>
>> $res->headers->({ 'Content-Disposition' =>
>> "attachment;filename=$name"} ); # CODE ref error
>>
>> $res->sendfile($filepath,0,$length); # Ok no such method but
>> hopefully you'll get what I mean.
>>
>> }
>
> open my $filehandle, '<', $filepath
> or die $!;
>
> $c->response->body( $filehandle );
Sorry. I mustn't be making myself clear.
I want the browser to offer the user a 'save as' dialogue box. The
modperl equivalent would be the RequestIO::sendfile
The above sends the contents of filepath to the browser
Thanx,
Dp.
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/