--- loncom/imspackages/imsprocessor.pm 2017/11/16 18:09:59 1.54.2.1 +++ loncom/imspackages/imsprocessor.pm 2018/05/02 17:08:40 1.57 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Processor for IMS Packages # -# $Id: imsprocessor.pm,v 1.54.2.1 2017/11/16 18:09:59 raeburn Exp $ +# $Id: imsprocessor.pm,v 1.57 2018/05/02 17:08:40 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -32,9 +32,9 @@ use Apache::lonnet; use Apache::loncommon; use Apache::loncleanup; use Apache::lonlocal; -use LWP::UserAgent; use HTTP::Request::Common; use LONCAPA::Configuration; +use LONCAPA::LWPReq; use strict; sub ims_config { @@ -140,7 +140,7 @@ sub uploadzip { unless ($fname) { return 'error: no uploaded file'; } # Save the file chomp($env{'form.uploadname'}); - open(my $fh,'>'.$tempdir.'/'.$fname); + open(my $fh,'>',"$tempdir/$fname"); print $fh $env{'form.uploadname'}; close($fh); } elsif ($context eq 'CSTR') { @@ -4963,9 +4963,9 @@ sub retrieve_image { my ($context,$res,$dirname,$cdom,$cname,$docroot,$destdir,$urlpath,$filename) = @_; my $contents; my $url = $urlpath.$filename; - my $ua=new LWP::UserAgent; + my $lonhost = $Apache::lonnet::perlvar{'lonHostID'}; my $request=new HTTP::Request('GET',$url); - my $response=$ua->request($request); + my $response=&LONCAPA::LWPReq::makerequest($lonhost,$request); if ($response->is_success) { $contents = $response->content; if (!-e "$docroot/$res") {