--- loncom/lonnet/perl/lonnet.pm 2004/07/06 18:02:33 1.521 +++ loncom/lonnet/perl/lonnet.pm 2004/07/22 22:12:06 1.523 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.521 2004/07/06 18:02:33 raeburn Exp $ +# $Id: lonnet.pm,v 1.523 2004/07/22 22:12:06 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1282,6 +1282,22 @@ sub userfileupload { # See if there is anything left unless ($fname) { return 'error: no uploaded file'; } chop($ENV{'form.'.$formname}); + if (($formname eq 'screenshot') && ($subdir eq 'helprequests')) { #files uploaded to help request form are handled differently + my $now = time; + my $filepath = 'tmp/helprequests/'.$now; + my @parts=split(/\//,$filepath); + my $fullpath = $perlvar{'lonDaemons'}; + for (my $i=0;$i<@parts;$i++) { + $fullpath .= '/'.$parts[$i]; + if ((-e $fullpath)!=1) { + mkdir($fullpath,0777); + } + } + open(my $fh,'>'.$fullpath.'/'.$fname); + print $fh $ENV{'form.'.$formname}; + close($fh); + return $fullpath.'/'.$fname; + } # Create the directory if not present my $docuname=''; my $docudom=''; @@ -4928,7 +4944,6 @@ sub getfile { } } else { $lwpresp = &getuploaded('GET',$file,$cdom,$cnum,\$info,\$rtncode); - &logthis("return is $lwpresp"); if ($lwpresp ne 'ok') { my $ua=new LWP::UserAgent; my $request=new HTTP::Request('GET',&tokenwrapper($file));