summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-12-04 20:00:43 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-12-04 20:00:43 +0000
commit6a2eeb821c7823ea2fa15be852174f40794d87ac (patch)
tree4c28decd9784c63112e036a7eb0d84a4ea0b568d /LedgerSMB
parent9eb0bb043420ce3647c45e7690cc3c33f005dcac (diff)
Encoding fixes for the backup routines
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1938 4979c152-3d1c-0410-bac9-87ea11338e46
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|;