Index: openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl,v diff -u -r1.35 -r1.35.8.1 --- openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl 24 Dec 2008 00:20:46 -0000 1.35 +++ openacs-4/packages/acs-tcl/tcl/apm-file-procs.tcl 24 Aug 2013 22:48:20 -0000 1.35.8.1 @@ -495,11 +495,20 @@ # reliably under windows, for unknown reasons the downloaded file is # truncated. # - # Therefore, we check first if the optional xotcl-core components - # are available... + # Therefore, we check first for the NaviServer built in ns_http, then + # if the optional xotcl-core components are available... # - if {[info command ::xo::HttpRequest] ne ""} { + if {[info command ::ns_http] ne ""} { # + # ... use ns_http ... + # + # ns_log notice "Transfer $url based to $output_file_name on ns_http" + set h [ns_http queue $url] + ns_http wait -file F -spoolsize 1 -timeout 10:0 $h + if {[file exists $output_file_name]} {file delete $output_file_name} + file rename $F $output_file_name + } elseif {[info command ::xo::HttpRequest] ne ""} { + # # ... use xo::HttpRequest... # #ns_log notice "Transfer $url based to $output_file_name on ::xo::HttpRequest" @@ -512,8 +521,8 @@ } elseif {[set wget [::util::which wget]] ne ""} { # - # ... if we have no ::xo::* and we have "wget" installed, we use - # it. + # ... if we have no ns_http, no ::xo::* and we have "wget" + # installed, we use it. # ns_log notice "Transfer $url based on wget" catch {exec $wget -O $output_file_name $url}