--- loncom/lonnet/perl/lonnet.pm 2004/07/16 17:56:01 1.522 +++ 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.522 2004/07/16 17:56:01 albertel 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='';