summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-xLedgerSMB/AM.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/LedgerSMB/AM.pm b/LedgerSMB/AM.pm
index 19a60f4b..328a745b 100755
--- a/LedgerSMB/AM.pm
+++ b/LedgerSMB/AM.pm
@@ -1615,7 +1615,7 @@ sub backup {
"${LedgerSMB::Sysconfig::backuppath}/$boundary.$globalDBname-$form->{dbversion}-$t[5]$t[4]$t[3].sql";
$form->{OUT} = "$tmpfile";
- open( OUT, '>', "$form->{OUT}" ) or $form->error("$form->{OUT} : $!");
+ open( OUT, '>:raw', "$form->{OUT}" ) or $form->error("$form->{OUT} : $!");
# get sequences, functions and triggers
@@ -1649,8 +1649,9 @@ qx(PGPASSWORD="$myconfig->{dbpasswd}" pg_dump -U $myconfig->{dbuser} -h $myconfi
if ( $form->{media} eq 'file' ) {
- open( IN, '<', "$tmpfile" ) or $form->error("$tmpfile : $!");
+ open( IN, '<:raw', "$tmpfile" ) or $form->error("$tmpfile : $!");
open( OUT, ">-" ) or $form->error("STDOUT : $!");
+ binmode( OUT, ':raw' );
print OUT qq|Content-Type: application/file;\n|
. qq|Content-Disposition: attachment; filename="$myconfig->{dbname}-$form->{dbversion}-$t[5]$t[4]$t[3].sql$suffix"\n\n|;