MARC import: part 4 of large file support
[koha_fer] / tools / export.pl
index 0370ee4..1fb1dae 100755 (executable)
@@ -16,7 +16,6 @@
 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA
 
-# $Id$
 
 use strict;
 require Exporter;
@@ -29,12 +28,13 @@ use C4::Branch;  # GetBranches
 
 my $query = new CGI;
 my $op=$query->param("op");
+my $filename=$query->param("filename");
 my $dbh=C4::Context->dbh;
 my $marcflavour = C4::Context->preference("marcflavour");
 
 if ($op eq "export") {
        print $query->header(   -type => 'application/octet-stream', 
-               -attachment=>'koha.mrc');
+                                                       -attachment=>$filename);
     
     my $StartingBiblionumber  = $query->param("StartingBiblionumber");
     my $EndingBiblionumber    = $query->param("EndingBiblionumber");
@@ -114,7 +114,7 @@ if ($op eq "export") {
             print $record->as_xml_record($marcflavour);
         }
         else {
-            print $record->as_formatted
+            print $record->as_usmarc()
         }
     }
     exit;