Perl CGI :: Application :: Plugin: Stream + Jquery Taconite plugin - Cannot upload file

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

+4
source share
2 answers

Until I can figure it out, I'm just going with a direct link to download the file. (i.e. no xmlhttp) to avoid the httpdata jquery route.

+1
source

Where does the file go if it is transferred?

0
source

All Articles