diff options
author | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-12-04 20:01:13 +0000 |
---|---|---|
committer | tetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-12-04 20:01:13 +0000 |
commit | 2f087465e4bd4ffed8b295cf82d3cf48e69ca216 (patch) | |
tree | 4139b6f8f3beb858fc6fc3826891e0edef0d0b21 | |
parent | 069650ee1433604b4c93d40ebfd7167603d6bf0f (diff) |
Encoding fixes for the backup routines
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1939 4979c152-3d1c-0410-bac9-87ea11338e46
-rw-r--r-- | LedgerSMB/AM.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/LedgerSMB/AM.pm b/LedgerSMB/AM.pm index 60d584a0..803a9f32 100644 --- a/LedgerSMB/AM.pm +++ b/LedgerSMB/AM.pm @@ -2087,7 +2087,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 @@ -2132,8 +2132,9 @@ LedgerSMB|, 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|; @@ -2411,3 +2412,4 @@ sub get_all_defaults { 1; =back + |