I use the Stream plugin (qw / stream_file /) for CGI :: Application in runmode mode to read a file from the file system and transfer it back to the user.
The user clicks on the link whose id attribute I use in an ajax call using jquery to retrieve the file (/? Mode = get_file & fileid = <someid>).
I also use the Jakery taconite plugin to update page content in other parts of my application; but I do not return xml to runmode get_file, which looks like this:
sub get_file{ my $self = shift; my $fileid=$self->query->param("fileid"); $self->header_add( -attachment => $fileid ); $self->header_add( -type => "application/x-download"); if ( $self->stream_file( $fileid ) ) { return; } else { return $self->error_mode(); } }
Result:
- The file becomes streaming, as expected (Firebug tells me about this)
- The headers look good (as shown in Firebug)
My problem:
- The contents of the file never appear to me as a file that can be downloaded.
My suspicion was that the taqconite plugin somehow removes the headers. However, I am not sure of the best way to solve it.
Any ideas would be most helpful.
Thanks / Ft
source share