Index: openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl,v diff -u -r1.37 -r1.38 --- openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl 21 Dec 2002 22:30:20 -0000 1.37 +++ openacs-4/packages/acs-tcl/tcl/00-database-procs-postgresql.tcl 27 Jan 2003 21:20:12 -0000 1.38 @@ -466,11 +466,7 @@ switch $storage_type { file { if {[file exists $content]} { - set ifp [open $content r] - set ofp [open $file w] - ns_cpfp $ifp $ofp - close $ifp - close $ofp + file copy -- $content $file } else { error "file: $content doesn't exist" } @@ -489,11 +485,7 @@ } } } elseif {[file exists $content]} { - set ifp [open $content r] - set ofp [open $file w] - ns_cpfp $ifp $ofp - close $ifp - close $ofp + file copy -- $content $file } elseif {[regexp {^[0-9]+$} $content match]} { ns_pg blob_select_file $db $content $file } else { @@ -508,6 +500,7 @@ file { if {[file exists $content]} { set ofp [open $content r] + fconfigure $ofp -encoding binary ns_writefp $ofp close $ofp } else { @@ -533,6 +526,7 @@ } } elseif {[file exists $content]} { set ofp [open $content r] + fconfigure $ofp -encoding binary ns_writefp $ofp close $ofp } elseif {[regexp {^[0-9]+$} $content match]} {