add more robust download functionality; convert to new API in Stexaminer::graphsvg
[scpubgit/stemmaweb.git] / lib / stemmaweb / View / GraphML.pm
index 3560dfc..5178bcd 100644 (file)
@@ -7,6 +7,10 @@ sub process {
        my( $self, $c ) = @_;
        $c->res->content_type( 'application/graphml+xml' );
        $c->res->content_encoding( 'UTF-8' );
+       if( $c->stash->{download} ) {
+               $c->res->header( 'Content-Disposition', 
+                       sprintf( "attachment; filename=\"%s.xml\"", $c->stash->{name} ) );
+       }
        $c->res->output( $c->stash->{result} );
 }