Index: openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl 1 Oct 2006 19:11:07 -0000 1.4 +++ openacs-4/packages/xotcl-core/tcl/bgdelivery-procs.tcl 22 Nov 2006 15:11:45 -0000 1.5 @@ -142,7 +142,12 @@ blocking a request thread. This is especially important when large files are requested over slow (e.g. dial-ip) connections. } { - bgdelivery returnfile $statuscode $mime_type $filename + if {[catch {ns_conn contentsentlength}]} { + ns_returnfile $statuscode $mime_type $filename + } else { + bgdelivery returnfile $statuscode $mime_type $filename + } + } #####################################