Hi
I am using Emberl 1.2.0.
 
This is the probleme :
I have a form with a submit bouton to download some data ( or a file ). I want that the user can save these data.
When I submit it, the header that I want to send to generate the download is printed in the page ( ...and the data too ) and after its the html part.
 
What's wrong ? The header ? The Method ?
 
Thanks
 
 
-------------------------------------------------------------------------------------------------------------------------------------------------
 
The result is :
 
Content-type: application/octet-stream Content-Transfer-Encoding: binary Content-Disposition: attachment; filename="logs.txt" one lineone lineone lineone lineone lineone lineone lineone lineone lineone lineone lineone lineone lineone lineone line etc...
 
...and the html part
 
The file "this_file.epl" :
 
[- if ( $fdat{'export'} ) {
    
    print "Content-type: application/octet-stream\n";
    print "Content-Transfer-Encoding: binary\n";
    print "Content-Disposition: attachment; filename=\"logs.txt\"\r\n\r\n";
Don't use print inside a Embperl page (unless you set optRedirectStdout). You can't print headers inside a Embperl page, that is done by Embperl. Assign them to the %http_headers hash, or use the $req_rec -> header_out mod_perl function.
 
Take a look at the Embperl Faq for examples
 
Gerald
 

Reply via email to